diff --git a/lib/templateFactory.js b/lib/templateFactory.js index 9d1d7688..173ddb6e 100644 --- a/lib/templateFactory.js +++ b/lib/templateFactory.js @@ -90,7 +90,7 @@ class TemplateFactory extends BaseFactory { */ getTemplate(config) { // get all templates with the same name - return super.list({ name: config.name }) + return super.list({ params: { name: config.name } }) .then((templates) => { // get templates that have version prefix as config.version const filtered = templates.filter(template => diff --git a/test/lib/templateFactory.test.js b/test/lib/templateFactory.test.js index 4b9f1b5c..6c208b43 100644 --- a/test/lib/templateFactory.test.js +++ b/test/lib/templateFactory.test.js @@ -231,6 +231,7 @@ describe('Template Factory', () => { datastore.scan.resolves(returnValue); return factory.getTemplate(config).then((model) => { + assert.calledWithMatch(datastore.scan, { params: { name: config.name } }); assert.instanceOf(model, Template); Object.keys(expected).forEach((key) => { assert.strictEqual(model[key], expected[key]);