Skip to content

Commit

Permalink
Merge pull request #157 from screwdriver-cd/templatepipelineid
Browse files Browse the repository at this point in the history
fix: Fix tests + comments after changing scmUri to pipelineId in templates
  • Loading branch information
d2lam authored Apr 18, 2017
2 parents a4d9a28 + 17f4954 commit 0f6d46d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ factory.create(config).then(model => {
| config.description | String | Yes | Description of the template |
| config.maintainer | Array | Yes | Maintainer's email |
| config.config | Object | Yes | Config of the screwdriver-template.yaml |
| config.scmUri | String | Yes | ScmUri of the template pipeline |
| config.pipelineId | String | Yes | pipelineId of the template |
| config.labels | Array | No | Labels attached to the template |

#### Get
Expand Down
8 changes: 4 additions & 4 deletions lib/templateFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class TemplateFactory extends BaseFactory {
* @param {String} config.description Description of the template
* @param {String} config.maintainer Maintainer's email
* @param {Object} config.config Config of the screwdriver-template.yaml
* @param {String} config.scmUri ScmUri of the template pipeline
* @param {Array} [config.labels] Labels attached to the template
* @param {String} config.pipelineId pipelineId of the template
* @param {Array} [config.labels] Labels attached to the template
* @return {Job}
*/
createClass(config) {
Expand All @@ -50,8 +50,8 @@ class TemplateFactory extends BaseFactory {
* @param {String} config.description Description of the template
* @param {String} config.maintainer Maintainer's email
* @param {Object} config.config Config of the screwdriver-template.yaml
* @param {String} config.scmUri ScmUri of the template pipeline
* @param {Array} [config.labels] Labels attached to the template
* @param {String} config.pipelineId pipelineId of the template
* @param {Array} [config.labels] Labels attached to the template
* @return {Promise}
*/
create(config) {
Expand Down
2 changes: 1 addition & 1 deletion test/lib/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Template Model', () => {
description: 'this is a template',
labels: ['test', 'beta'],
config: { image: 'node:6' },
scmUri: 'github.com:123:master'
pipelineId: '123'
};
template = new TemplateModel(createConfig);
});
Expand Down
14 changes: 7 additions & 7 deletions test/lib/templateFactory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ describe('Template Factory', () => {
const description = 'this is a template';
const labels = ['test', 'beta'];
const templateConfig = { image: 'node:6' };
const scmUri = 'github.com:123:master';
const pipelineId = '123';
const metaData = {
name,
version,
maintainer,
description,
labels,
config: templateConfig,
scmUri
pipelineId
};
let TemplateFactory;
let datastore;
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('Template Factory', () => {
description,
labels,
config: templateConfig,
scmUri,
pipelineId,
id: generatedId
};
});
Expand All @@ -98,7 +98,7 @@ describe('Template Factory', () => {
description,
labels,
config: templateConfig,
scmUri
pipelineId
}).then((model) => {
assert.instanceOf(model, Template);
Object.keys(expected).forEach((key) => {
Expand All @@ -120,7 +120,7 @@ describe('Template Factory', () => {
description,
labels,
config: templateConfig,
scmUri
pipelineId
}).then((model) => {
assert.instanceOf(model, Template);
Object.keys(expected).forEach((key) => {
Expand All @@ -137,7 +137,7 @@ describe('Template Factory', () => {
description,
labels,
config: templateConfig,
scmUri,
pipelineId,
id: generatedId
};

Expand All @@ -153,7 +153,7 @@ describe('Template Factory', () => {
description,
labels,
config: templateConfig,
scmUri
pipelineId
}).then((model) => {
assert.instanceOf(model, Template);
Object.keys(expected).forEach((key) => {
Expand Down

0 comments on commit 0f6d46d

Please sign in to comment.