mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Restore the userCreated event
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
const app = require('../../../../../app');
|
||||
const Context = require('../../../../../graph/context');
|
||||
const UsersService = require('../../../../../services/users');
|
||||
|
||||
const chai = require('chai');
|
||||
chai.should();
|
||||
chai.use(require('chai-http'));
|
||||
const expect = chai.expect;
|
||||
|
||||
const UsersService = require('../../../../../services/users');
|
||||
|
||||
describe('/api/v1/auth', () => {
|
||||
describe('#get', () => {
|
||||
it('should return nothing when no user is logged in', () => {
|
||||
@@ -32,7 +32,9 @@ describe('/api/v1/auth/local', () => {
|
||||
};
|
||||
await SettingsService.init(settings);
|
||||
|
||||
const ctx = Context.forSystem();
|
||||
mockUser = await UsersService.createLocalUser(
|
||||
ctx,
|
||||
'maria@gmail.com',
|
||||
'password!',
|
||||
'Maria'
|
||||
|
||||
@@ -3,6 +3,7 @@ const passport = require('../../../passport');
|
||||
const app = require('../../../../../app');
|
||||
const mailer = require('../../../../../services/mailer');
|
||||
|
||||
const Context = require('../../../../../graph/context');
|
||||
const SettingsService = require('../../../../../services/settings');
|
||||
const settings = {
|
||||
id: '1',
|
||||
@@ -20,19 +21,16 @@ const UsersService = require('../../../../../services/users');
|
||||
describe('/api/v1/users/:user_id/email/confirm', () => {
|
||||
let mockUser;
|
||||
|
||||
beforeEach(() =>
|
||||
SettingsService.init(settings)
|
||||
.then(() => {
|
||||
return UsersService.createLocalUser(
|
||||
'ana@gmail.com',
|
||||
'123321123',
|
||||
'Ana'
|
||||
);
|
||||
})
|
||||
.then(user => {
|
||||
mockUser = user;
|
||||
})
|
||||
);
|
||||
beforeEach(async () => {
|
||||
await SettingsService.init(settings);
|
||||
const ctx = Context.forSystem();
|
||||
mockUser = await UsersService.createLocalUser(
|
||||
ctx,
|
||||
'ana@gmail.com',
|
||||
'123321123',
|
||||
'Ana'
|
||||
);
|
||||
});
|
||||
|
||||
describe('#post', () => {
|
||||
it('should send an email when we hit the endpoint', () => {
|
||||
|
||||
Reference in New Issue
Block a user