rm storage.storage to storage.db
This commit is contained in:
parent
c4c7dc8eb1
commit
028a300012
7 changed files with 39 additions and 34 deletions
|
|
@ -14,11 +14,12 @@ describe('Profile model', function() {
|
|||
var storage = new FakeStorage();
|
||||
var opts = {
|
||||
email: email,
|
||||
password: password,
|
||||
};
|
||||
|
||||
beforeEach(function() {
|
||||
storage.getItem = sinon.stub();
|
||||
storage.setFromObj = sinon.stub();
|
||||
storage.setFromObj.yields(null);
|
||||
});
|
||||
|
||||
it('should fail create an instance', function() {
|
||||
|
|
@ -32,21 +33,20 @@ describe('Profile model', function() {
|
|||
it('should create an instance', function() {
|
||||
var p = new Profile({
|
||||
email: email,
|
||||
password: password
|
||||
}, storage);
|
||||
}, password, storage);
|
||||
should.exist(p);
|
||||
});
|
||||
|
||||
it('#fromObj #toObj round trip', function() {
|
||||
|
||||
var p = new Profile(opts, storage);
|
||||
var p2 = Profile.fromObj(p.toObj(), storage);
|
||||
var p = new Profile(opts, password, storage);
|
||||
var p2 = Profile.fromObj(p.toObj(), password, storage);
|
||||
p2.should.deep.equal(p);
|
||||
});
|
||||
|
||||
it('#store', function(done) {
|
||||
var p = new Profile(opts, storage);
|
||||
var p = new Profile(opts, password, storage);
|
||||
p.store(function(err) {
|
||||
storage.setFromObj.getCall(0).args[1].should.deep.equal(p.toObj());
|
||||
should.not.exist(err);
|
||||
done();
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue