Skip to content

Commit

Permalink
fix(server): make user tests run more consistently
Browse files Browse the repository at this point in the history
require app so user tests can run independently of other tests

use `beforeEach` to remove users instead of `before` so tests run more consistently

closes #346
  • Loading branch information
DaftMonk committed Jul 14, 2014
1 parent 4ef9f57 commit addb506
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions app/templates/server/api/user(auth)/user.model.spec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
'use strict';

var should = require('should');
var app = require('../../app');
var User = require('./user.model');

var user;
var user = new User({
provider: 'local',
name: 'Fake User',
email: '[email protected]',
password: 'password'
});

describe('User Model', function() {
before(function(done) {
user = new User({
provider: 'local',
name: 'Fake User',
email: '[email protected]',
password: 'password'
});

beforeEach(function(done) {
// Clear users before testing
User.remove().exec().then(function() {
done();
Expand Down

0 comments on commit addb506

Please sign in to comment.