-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,17 +31,17 @@ describe('lockit-mongodb-adapter', function() { | |
}); | ||
}); | ||
|
||
it('should find a user by username', function(done) { | ||
adapter.find('username', 'john', function(err, res) { | ||
it('should find a user by name', function(done) { | ||
adapter.find('name', 'john', function(err, res) { | ||
if (err) console.log(err); | ||
res.username.should.equal('john'); | ||
res.name.should.equal('john'); | ||
res.email.should.equal('[email protected]'); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should return undefined when no user is found', function(done) { | ||
adapter.find('username', 'jim', function(err, res) { | ||
adapter.find('name', 'jim', function(err, res) { | ||
if (err) console.log(err); | ||
should.not.exist(err); | ||
should.not.exist(res); | ||
|
@@ -52,7 +52,7 @@ describe('lockit-mongodb-adapter', function() { | |
it('should find a user by email', function(done) { | ||
adapter.find('email', '[email protected]', function(err, res) { | ||
if (err) console.log(err); | ||
res.username.should.equal('john'); | ||
res.name.should.equal('john'); | ||
res.email.should.equal('[email protected]'); | ||
done(); | ||
}); | ||
|
@@ -61,14 +61,14 @@ describe('lockit-mongodb-adapter', function() { | |
it('should find a user by signup token', function(done) { | ||
adapter.find('signupToken', _tmp_signupToken, function(err, res) { | ||
if (err) console.log(err); | ||
res.username.should.equal('john'); | ||
res.name.should.equal('john'); | ||
res.email.should.equal('[email protected]'); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should update an existing user', function(done) { | ||
adapter.find('username', 'john', function(err, doc) { | ||
adapter.find('name', 'john', function(err, doc) { | ||
if (err) console.log(err); | ||
doc.test = 'works'; | ||
doc.editet = true; | ||
|
@@ -81,8 +81,6 @@ describe('lockit-mongodb-adapter', function() { | |
}); | ||
}); | ||
|
||
|
||
|
||
it('should remove a user', function(done) { | ||
adapter.save('jeff', '[email protected]', 'secret', function(err, res) { | ||
if (err) console.log(err); | ||
|
@@ -105,7 +103,5 @@ describe('lockit-mongodb-adapter', function() { | |
|
||
// remove users db | ||
after(function(done) { | ||
|
||
adapter.remove('john', done); | ||
|
||
}); |