From 20d1f86fb6ed6538929b3235a429833fbb320e0c Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Thu, 25 Jan 2018 00:55:39 +0100 Subject: [PATCH] Fixed broken payload in posts_spec.js no issue - the affected test had a wrong payload, but passed anyway because the previous test edited the same title ;) - this routing test does currently truncate the tables after each test case - the test can run faster - if we achieve reducing the routing tests, we can reconsider truncating the db --- core/test/functional/routes/api/posts_spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/test/functional/routes/api/posts_spec.js b/core/test/functional/routes/api/posts_spec.js index 95b1b8ba31..1d24b50d76 100644 --- a/core/test/functional/routes/api/posts_spec.js +++ b/core/test/functional/routes/api/posts_spec.js @@ -1044,10 +1044,11 @@ describe('Post API', function () { } var jsonResponse = res.body, - changedValue = 'My new Title'; + changedValue = 'A title.'; + should.exist(jsonResponse); - jsonResponse.title = changedValue; - jsonResponse.published_at = null; + jsonResponse.posts[0].title = changedValue; + jsonResponse.posts[0].published_at = null; request.put(testUtils.API.getApiQuery('posts/' + testUtils.DataGenerator.Content.posts[0].id + '/')) .set('Authorization', 'Bearer ' + ownerAccessToken)