Renamed method
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
310b5007f2
commit
e557bd2815
|
@ -3,7 +3,7 @@ const fs = require('fs-extra');
|
|||
const path = require('path');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('download', {
|
||||
Self.remoteMethod('downloadImages', {
|
||||
description: 'Returns last entries',
|
||||
accessType: 'WRITE',
|
||||
returns: {
|
||||
|
@ -11,12 +11,12 @@ module.exports = Self => {
|
|||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/download`,
|
||||
verb: 'GET'
|
||||
path: `/downloadImages`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
Self.download = async() => {
|
||||
Self.downloadImages = async() => {
|
||||
const models = Self.app.models;
|
||||
|
||||
try {
|
|
@ -0,0 +1,17 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const fs = require('fs-extra');
|
||||
|
||||
// #2367 - Create tests when table itemImageQueue exists
|
||||
xdescribe('ItemImageQueue downloadImages()', () => {
|
||||
it('should iterate over images', async() => {
|
||||
spyOn(fs, 'mkdir');
|
||||
spyOn(fs, 'createWriteStream');
|
||||
|
||||
const models = app.models;
|
||||
const imageModel = spyOn(models.Image, 'registerImage');
|
||||
|
||||
const res = await app.models.ItemImageQueue.downloadImages();
|
||||
|
||||
expect(res).toEqual(1);
|
||||
});
|
||||
});
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/item-image-queue/download')(Self);
|
||||
require('../methods/item-image-queue/downloadImages')(Self);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue