Moving settings to mocks.

This commit is contained in:
David Jay
2016-11-30 16:27:03 -05:00
parent 2b0a503c6a
commit 7503ba9ab3
2 changed files with 8 additions and 4 deletions
+4
View File
@@ -2,6 +2,7 @@ const Comments = require('../../models/comment');
const Users = require('../../models/user');
const Actions = require('../../models/action');
const Assets = require('../../models/asset');
const Settings = require('../../models/setting');
const globals = require('./globals');
/* Create an array of comments */
@@ -19,3 +20,6 @@ module.exports.users = (users) => Users.createLocalUsers(users);
/* Create an array of actions */
module.exports.actions = (actions) => Actions.create(actions);
/* Update a setting */
module.exports.settings = (setting) => Settings.init().then(() => Settings.updateSettings(setting));
+4 -4
View File
@@ -16,7 +16,7 @@ module.exports = {
},
'User registers and posts a comment with premod off': client => {
client.perform((client, done) => {
client.page.embedStream().setConfig({moderation: 'post'}, client.globals.baseUrl)
mocks.settings({moderation: 'pre'})
.then(() => {
//Load Page
client.resizeWindow(1200, 800)
@@ -52,7 +52,7 @@ module.exports = {
},
'User posts a comment with premod on': client => {
client.perform((client, done) => {
client.page.embedStream().setConfig({moderation: 'pre'}, client.globals.baseUrl)
mocks.settings({moderation: 'pre'})
.then(() => {
//Load Page
client.url(client.globals.baseUrl)
@@ -73,7 +73,7 @@ module.exports = {
},
'User replies to a comment with premod off': client => {
client.perform((client, done) => {
client.page.embedStream().setConfig({moderation: 'post'}, client.globals.baseUrl)
mocks.settings({moderation: 'pre'})
.then(() => {
//Load Page
client.resizeWindow(1200, 800)
@@ -96,7 +96,7 @@ module.exports = {
},
'User replies to a comment with premod on': client => {
client.perform((client, done) => {
client.page.embedStream().setConfig({moderation: 'pre'}, client.globals.baseUrl)
mocks.settings({moderation: 'pre'})
// Add a mock user
.then(() => mocks.users([{
displayName: 'Baby Blue',