forked from saintedlama/passport-local-mongoose
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
15e8981
commit 3052f2d
Showing
3 changed files
with
57 additions
and
26 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 |
---|---|---|
|
@@ -5,7 +5,7 @@ var passportLocalMongoose = require('../lib/passport-local-mongoose'); | |
var mongotest = require('./mongotest'); | ||
|
||
describe('alternative query field', function () { | ||
beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongooseissues')); | ||
beforeEach(mongotest.prepareDb('mongodb://boot2docker/passportlocalmongooseissues')); | ||
afterEach(mongotest.disconnect()); | ||
|
||
it('should find an existing user by alternative query field', function (done) { | ||
|
@@ -21,7 +21,7 @@ describe('alternative query field', function () { | |
var user = new User({ username : 'hugo', email : email }); | ||
user.save(function (err) { | ||
assert.ifError(err); | ||
|
||
User.findByUsername(email, function (err, user) { | ||
assert.ifError(err); | ||
assert.ok(user); | ||
|
@@ -31,7 +31,7 @@ describe('alternative query field', function () { | |
}); | ||
}); | ||
}); | ||
|
||
it('should authenticate an existing user by alternative query field', function (done) { | ||
this.timeout(5000); // Five seconds - mongo db access needed | ||
|
||
|
@@ -45,7 +45,7 @@ describe('alternative query field', function () { | |
var user = new User({ username : 'hugo', email : email }); | ||
User.register(user, 'password', function (err) { | ||
assert.ifError(err); | ||
|
||
User.authenticate()('[email protected]', 'password', function(err, user, message) { | ||
assert.ifError(err); | ||
assert.ok(user); | ||
|
@@ -54,8 +54,8 @@ describe('alternative query field', function () { | |
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
it('should authenticate an existing user by default username field', function (done) { | ||
this.timeout(5000); // Five seconds - mongo db access needed | ||
|
||
|
@@ -69,7 +69,7 @@ describe('alternative query field', function () { | |
var user = new User({ username : 'hugo', email : email }); | ||
User.register(user, 'password', function (err) { | ||
assert.ifError(err); | ||
|
||
User.authenticate()('hugo', 'password', function(err, user, message) { | ||
assert.ifError(err); | ||
assert.ok(user); | ||
|
@@ -78,8 +78,8 @@ describe('alternative query field', function () { | |
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
it('should not authenticate an existing user by unconfigured alternative query field', function (done) { | ||
this.timeout(5000); // Five seconds - mongo db access needed | ||
|
||
|
@@ -93,7 +93,7 @@ describe('alternative query field', function () { | |
var user = new User({ username : 'hugo', email : email }); | ||
User.register(user, 'password', function (err) { | ||
assert.ifError(err); | ||
|
||
User.authenticate()('[email protected]', 'password', function(err, user, message) { | ||
assert.ifError(err); | ||
assert.ok(!user); | ||
|
@@ -102,5 +102,5 @@ describe('alternative query field', function () { | |
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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