tests: Remove dependency on mongoose User model in auth tests

This commit is contained in:
Blade Barringer
2016-03-18 07:57:42 -05:00
parent 2ef176c6f2
commit f6f5b1a118
2 changed files with 3 additions and 5 deletions

View File

@@ -2,7 +2,6 @@ import {
generateUser,
translate as t,
} from '../../../../../helpers/api-v3-integration.helper';
import { model as User } from '../../../../../../website/src/models/user';
describe('PUT /user/auth/update-username', async () => {
let endpoint = '/user/auth/update-username';
@@ -22,7 +21,7 @@ describe('PUT /user/auth/update-username', async () => {
password,
});
expect(response).to.eql({ username: newUsername });
user = await User.findOne({ _id: user._id });
await user.sync();
expect(user.auth.local.username).to.eql(newUsername);
});