-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserOptions.js
38 lines (32 loc) · 957 Bytes
/
UserOptions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require('./setup');
describe('UserOptions', function() {
var db, userDao, user;
beforeEach(function() {
setUpDi();
db = di.get('db');
userDao = di.get('userDao');
return db.query('delete from users;')
.then(function() {
return userDao.create('testuser', 'test@test.com', 'abc')
})
.then(function(setUser) {
user = setUser;
});
});
it('returns empty object by default', function() {
return user.getOptions()
.then(function(options) {
assert.deepEqual(options, {});
});
})
it('setting and getting works', function() {
var options = {foo: 'bar'};
return user.setOptions(options)
.then(function() {
return user.getOptions();
})
.then(function(retrievedOptions) {
assert.deepEqual(retrievedOptions, options);
})
});
});