Skip to content

Commit

Permalink
Merge pull request #154 from screwdriver-cd/fix
Browse files Browse the repository at this point in the history
fix: list need an extra layer of params
  • Loading branch information
d2lam authored Mar 24, 2017
2 parents 132b9e7 + a03e3ea commit a4d9a28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/templateFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
1 change: 1 addition & 0 deletions test/lib/templateFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit a4d9a28

Please sign in to comment.