mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Fixed adapter-related unit test
refs37dd187fe6
refsc36575627d/ghost/core/core/server/data/importer/handlers/image.js (L16)
- The tests were failing because they were stubbing a "generic" adapter, instead of the one which the module under test was using (see referenced code to see what I mean)
This commit is contained in:
parent
c36575627d
commit
920a3aeb4c
2 changed files with 4 additions and 4 deletions
|
@ -481,7 +481,7 @@ describe('Importer', function () {
|
|||
});
|
||||
|
||||
describe('ImageHandler', function () {
|
||||
const store = storage.getStorage();
|
||||
const store = storage.getStorage('images');
|
||||
|
||||
it('has the correct interface', function () {
|
||||
ImageHandler.type.should.eql('images');
|
||||
|
|
|
@ -271,7 +271,7 @@ describe('lib/mobiledoc', function () {
|
|||
});
|
||||
|
||||
it('does not render srcsets with incompatible storage engine', function () {
|
||||
sinon.stub(storage.getStorage(), 'saveRaw').value(null);
|
||||
sinon.stub(storage.getStorage('images'), 'saveRaw').value(null);
|
||||
|
||||
let mobiledoc = {
|
||||
version: '0.3.1',
|
||||
|
@ -299,11 +299,11 @@ describe('lib/mobiledoc', function () {
|
|||
|
||||
beforeEach(function () {
|
||||
originalStoragePath = storage.getStorage().storagePath;
|
||||
storage.getStorage().storagePath = path.join(__dirname, '../../../utils/fixtures/images/');
|
||||
storage.getStorage('images').storagePath = path.join(__dirname, '../../../utils/fixtures/images/');
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
storage.getStorage().storagePath = originalStoragePath;
|
||||
storage.getStorage('images').storagePath = originalStoragePath;
|
||||
});
|
||||
|
||||
it('works', async function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue