From aef3d7f3f325284c67afa63505ff2630c20a3642 Mon Sep 17 00:00:00 2001 From: Katharina Irrgang Date: Tue, 12 Sep 2017 17:51:40 +0200 Subject: [PATCH] Tests: Fix one more random failure (#9004) refs #7470 - this should fix https://github.com/TryGhost/Ghost/issues/7470#issuecomment-321016771 - the importer adds posts in parallel, but the tests read directly from the db without any order - use findPage (findAll does not support order yet) --- .../test/integration/data/importer/importers/data_spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/test/integration/data/importer/importers/data_spec.js b/core/test/integration/data/importer/importers/data_spec.js index b62fcb273c..e7ae02e879 100644 --- a/core/test/integration/data/importer/importers/data_spec.js +++ b/core/test/integration/data/importer/importers/data_spec.js @@ -128,7 +128,7 @@ describe('Import', function () { // Grab the data from tables return Promise.all([ knex('users').select(), - knex('posts').select(), + models.Post.findPage(testUtils.context.internal), knex('settings').select(), knex('tags').select(), knex('subscribers').select() @@ -139,7 +139,7 @@ describe('Import', function () { importedData.length.should.equal(5, 'Did not get data successfully'); var users = importedData[0], - posts = importedData[1], + posts = importedData[1].posts, settings = importedData[2], tags = importedData[3], subscribers = importedData[4]; @@ -151,8 +151,8 @@ describe('Import', function () { // import no longer requires all data to be dropped, and adds posts posts.length.should.equal(exportData.data.posts.length, 'Wrong number of posts'); - posts[0].status.should.eql('published'); - posts[1].status.should.eql('scheduled'); + posts[0].status.should.eql('scheduled'); + posts[1].status.should.eql('published'); // test settings settings.length.should.be.above(0, 'Wrong number of settings');