rm storage.storage to storage.db

This commit is contained in:
Matias Alejo Garcia 2014-09-27 18:00:27 -03:00
commit 028a300012
7 changed files with 39 additions and 34 deletions

View file

@ -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();
})