Browse Source

ignore unrecognized preferences

activeAddress
Ivan Socolsky 10 years ago
parent
commit
116bea1aa5
  1. 2
      lib/server.js
  2. 2
      test/integration/server.js

2
lib/server.js

@ -479,6 +479,8 @@ WalletService.prototype.savePreferences = function(opts, cb) {
}, },
}]; }];
opts = _.pick(opts, _.pluck(preferences, 'name'));
try { try {
_.each(preferences, function(preference) { _.each(preferences, function(preference) {
var value = opts[preference.name]; var value = opts[preference.name];

2
test/integration/server.js

@ -1158,6 +1158,7 @@ describe('Wallet service', function() {
email: 'dummy@dummy.com', email: 'dummy@dummy.com',
language: 'es', language: 'es',
unit: 'bit', unit: 'bit',
dummy: 'ignored',
}, function(err) { }, function(err) {
should.not.exist(err); should.not.exist(err);
server.getPreferences({}, function(err, preferences) { server.getPreferences({}, function(err, preferences) {
@ -1166,6 +1167,7 @@ describe('Wallet service', function() {
preferences.email.should.equal('dummy@dummy.com'); preferences.email.should.equal('dummy@dummy.com');
preferences.language.should.equal('es'); preferences.language.should.equal('es');
preferences.unit.should.equal('bit'); preferences.unit.should.equal('bit');
should.not.exist(preferences.dummy);
done(); done();
}); });
}); });

Loading…
Cancel
Save