Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,12 @@ var genUser = function() {
};

describe('User Model', function() {
before(function() {
// Clear users before testing
return User.removeAsync();
});
// Clear users before testing
before(User.removeAsync.bind(User));

beforeEach(function() {
genUser();
});
beforeEach(genUser);

afterEach(function() {
return User.removeAsync();
});
afterEach(User.removeAsync.bind(User));

it('should begin with no users', function() {
return User.findAsync({})
Expand All @@ -48,9 +42,7 @@ describe('User Model', function() {
});

describe('#password', function() {
beforeEach(function() {
return user.saveAsync();
});
beforeEach(user.saveAsync.bind(user));

it('should authenticate user if valid', function() {
user.authenticate('password').should.be.true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ describe('User Model', function() {
});
});

beforeEach(function() {
genUser();
});
beforeEach(genUser);

afterEach(function() {
return User.destroy({ where: {} });
Expand All @@ -50,9 +48,7 @@ describe('User Model', function() {
});

describe('#password', function() {
beforeEach(function() {
return user.save();
});
beforeEach(user.save.bind(user));

it('should authenticate user if valid', function() {
user.authenticate('password').should.be.true;
Expand Down