mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
Fixer pre/post
This commit is contained in:
@@ -15,7 +15,7 @@ const CommentsService = require('../../../../services/comments');
|
||||
const UsersService = require('../../../../services/users');
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
|
||||
const settings = {id: '1', moderation: 'pre', wordlist: {banned: ['bad words'], suspect: ['suspect words']}};
|
||||
const settings = {id: '1', moderation: 'PRE', wordlist: {banned: ['bad words'], suspect: ['suspect words']}};
|
||||
|
||||
describe('/api/v1/comments', () => {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ const Action = require('../../../../models/action');
|
||||
const UsersService = require('../../../../services/users');
|
||||
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
const settings = {id: '1', moderation: 'pre', wordlist: {banned: ['banned'], suspect: ['suspect']}};
|
||||
const settings = {id: '1', moderation: 'PRE', wordlist: {banned: ['banned'], suspect: ['suspect']}};
|
||||
|
||||
describe('/api/v1/queue', () => {
|
||||
const comments = [{
|
||||
|
||||
@@ -8,7 +8,7 @@ chai.should();
|
||||
chai.use(require('chai-http'));
|
||||
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
const defaults = {id: '1', moderation: 'pre'};
|
||||
const defaults = {id: '1', moderation: 'PRE'};
|
||||
|
||||
describe('/api/v1/settings', () => {
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('/api/v1/settings', () => {
|
||||
.then((res) => {
|
||||
expect(res).to.have.status(200);
|
||||
expect(res).to.be.json;
|
||||
expect(res.body).to.have.property('moderation', 'pre');
|
||||
expect(res.body).to.have.property('moderation', 'PRE');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -36,14 +36,14 @@ describe('/api/v1/settings', () => {
|
||||
return chai.request(app)
|
||||
.put('/api/v1/settings')
|
||||
.set(passport.inject({roles: ['ADMIN']}))
|
||||
.send({moderation: 'post'})
|
||||
.send({moderation: 'POST'})
|
||||
.then((res) => {
|
||||
expect(res).to.have.status(204);
|
||||
|
||||
return SettingsService.retrieve();
|
||||
})
|
||||
.then((settings) => {
|
||||
expect(settings).to.have.property('moderation', 'post');
|
||||
expect(settings).to.have.property('moderation', 'POST');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ const chai = require('chai');
|
||||
const expect = chai.expect;
|
||||
|
||||
const SettingsService = require('../../../../services/settings');
|
||||
const settings = {id: '1', moderation: 'pre', wordlist: {banned: ['bad words'], suspect: ['suspect words']}};
|
||||
const settings = {id: '1', moderation: 'PRE', wordlist: {banned: ['bad words'], suspect: ['suspect words']}};
|
||||
|
||||
// Setup chai.
|
||||
chai.should();
|
||||
|
||||
Reference in New Issue
Block a user