From 1af25bb2a7610d3f50c4dd1c0d21318c620e0ca2 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 13 Feb 2017 16:29:56 -0500 Subject: [PATCH] Updating mocks. --- scripts/pree2e.sh | 3 +++ test/e2e/mocks.js | 2 +- test/e2e/tests/EmbedStreamTests.js | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/pree2e.sh b/scripts/pree2e.sh index 9ed5b7b89..da308f738 100755 --- a/scripts/pree2e.sh +++ b/scripts/pree2e.sh @@ -3,6 +3,9 @@ # install selenium selenium-standalone install --config=./selenium.config.js +# Clear db +mongo test --eval "db.dropDatabase()" + # Init application ./bin/cli setup --defaults diff --git a/test/e2e/mocks.js b/test/e2e/mocks.js index 07693651d..f1e46f0ea 100644 --- a/test/e2e/mocks.js +++ b/test/e2e/mocks.js @@ -12,7 +12,7 @@ module.exports.comments = (comments) => Assets.findOrCreateByUrl(globals.baseUrl comment.asset_id = asset.id; return comment; }); - return Comments.create(comments); + return Comments.publicCreate(comments); }); /* Create an array of users */ diff --git a/test/e2e/tests/EmbedStreamTests.js b/test/e2e/tests/EmbedStreamTests.js index 5591d6b8d..1b8172ef5 100644 --- a/test/e2e/tests/EmbedStreamTests.js +++ b/test/e2e/tests/EmbedStreamTests.js @@ -125,15 +125,15 @@ module.exports = { // Add a mock user .then(() => mocks.users([{ - displayName: 'Baby Blue', + displayName: 'BabyBlue', email: 'whale@tale.sea', - password: 'krill' + password: 'krillaretasty' }])) // Add a mock preapproved comment by that user .then((user) => mocks.comments([{ body: 'Whales are not fish.', - status: 'accepted', + status: 'ACCEPTED', author_id: user.id }])) .then(() => {