Skip to content

Commit

Permalink
[test] test if existing record doesn't get overriden when trying to r…
Browse files Browse the repository at this point in the history
…egister existing user
  • Loading branch information
mmalecki committed Aug 31, 2011
1 parent 14289e3 commit 7cbb99e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/test-login.js
Expand Up @@ -86,11 +86,17 @@ module.exports = testCase({
});
},
testRegisterExistingUser: function (test) {
test.expect(2);
var self = this;

test.expect(3);
this.login.userRegister(this.email, 'whatever', function (err, res) {
test.ok(err, 'should return error when trying to register existing user');
test.equal(err.code, login.Login.USER_EXISTS, 'should return proper error code');
test.done();

db.get(self.id, function (err, doc) {
test.equal(doc._rev, self.rev, 'document should not get overriden');
});
});
},
tearDown: function (callback) {
Expand Down

0 comments on commit 7cbb99e

Please sign in to comment.