mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Extracted LTS spec out of importer test suite
refs https://github.com/TryGhost/Team/issues/555 - Follow up to previous commit. Read it for full context. - This step splits existing importer test suite into separate files based on current "describe sections". This is done to get the test suite size to somewhat comprehensive shape
This commit is contained in:
parent
4f83716cfe
commit
0bc33d6816
2 changed files with 27 additions and 18 deletions
|
@ -21,7 +21,7 @@ const importOptions = {
|
|||
|
||||
const knex = db.knex;
|
||||
|
||||
const {exportedPreviousBody, exportedLegacyBody, exportedLatestBody} = require('./utils/fixtures');
|
||||
const {exportedPreviousBody, exportedLatestBody} = require('./utils/fixtures');
|
||||
|
||||
// Tests in here do an import for each test
|
||||
describe('Integration: Importer', function () {
|
||||
|
@ -1542,20 +1542,3 @@ describe('1.0', function () {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('LTS', function () {
|
||||
beforeEach(testUtils.teardownDb);
|
||||
beforeEach(testUtils.setup('roles', 'owner', 'settings'));
|
||||
|
||||
it('disallows importing LTS imports', function () {
|
||||
const exportData = exportedLegacyBody().db[0];
|
||||
|
||||
return dataImporter.doImport(exportData, importOptions)
|
||||
.then(function () {
|
||||
'0'.should.eql(1, 'LTS import should fail');
|
||||
})
|
||||
.catch(function (err) {
|
||||
err.message.should.eql('Detected unsupported file structure.');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
26
test/regression/importer/lts_spec.js
Normal file
26
test/regression/importer/lts_spec.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
const testUtils = require('../../utils');
|
||||
const importer = require('../../../core/server/data/importer');
|
||||
const dataImporter = importer.importers[1];
|
||||
|
||||
const {exportedLegacyBody} = require('./utils/fixtures');
|
||||
|
||||
const importOptions = {
|
||||
returnImportedData: true
|
||||
};
|
||||
|
||||
describe('Integration: Importer LTS', function () {
|
||||
beforeEach(testUtils.teardownDb);
|
||||
beforeEach(testUtils.setup('roles', 'owner', 'settings'));
|
||||
|
||||
it('disallows importing LTS imports', function () {
|
||||
const exportData = exportedLegacyBody().db[0];
|
||||
|
||||
return dataImporter.doImport(exportData, importOptions)
|
||||
.then(function () {
|
||||
'0'.should.eql(1, 'LTS import should fail');
|
||||
})
|
||||
.catch(function (err) {
|
||||
err.message.should.eql('Detected unsupported file structure.');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Reference in a new issue