Skip to content

Commit a735aa9

Browse files
committed
Simplify the API test for invalidCredentials (removed create), move above REST calls for better grouping of tests
- strongloop#944
1 parent 8cbc00f commit a735aa9

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

test/user.test.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ describe('User', function() {
200200
});
201201
});
202202

203+
it('Login should only allow correct credentials', function(done) {
204+
User.login(invalidCredentials, function(err, accessToken) {
205+
assert(err);
206+
assert(!accessToken);
207+
done();
208+
});
209+
});
210+
203211
it('Login a user over REST by providing credentials', function(done) {
204212
request(app)
205213
.post('/users/login')
@@ -300,15 +308,6 @@ describe('User', function() {
300308
});
301309
});
302310

303-
it('Login should only allow correct credentials', function(done) {
304-
User.create({email: '[email protected]', password: 'bar'}, function(user, err) {
305-
User.login({email: '[email protected]', password: 'bar'}, function(err, accessToken) {
306-
assert(err);
307-
assert(!accessToken);
308-
done();
309-
});
310-
});
311-
});
312311
});
313312

314313
function assertGoodToken(accessToken) {

0 commit comments

Comments
 (0)