Renamed method
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-07-14 11:16:50 +02:00
parent 310b5007f2
commit e557bd2815
3 changed files with 22 additions and 5 deletions

View File

@ -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 {

View File

@ -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);
});
});

View File

@ -1,3 +1,3 @@
module.exports = Self => {
require('../methods/item-image-queue/download')(Self);
require('../methods/item-image-queue/downloadImages')(Self);
};