Skip to content

Commit

Permalink
test: exclude default custom parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
theoomoregbee committed Jul 28, 2019
1 parent b28dfb3 commit c321bd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/generators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ describe('Generators', function () {
controller: 'UserController',
action: 'create',
swagger: {
body: modifiedAttr
body: modifiedAttr,
excludeParameters: ['#/parameters/TokenHeaderParam']
}
},
'put /user/:id': {
Expand Down Expand Up @@ -524,6 +525,11 @@ describe('Generators', function () {
done();
});

it('should exclude default parameters specified in excludeParamters', function (done) {
assert.notIncludeDeepMembers(actual['/user'].post.parameters, [{$ref: '#/parameters/TokenHeaderParam'}]);
done();
});

it('should add form body for default blueprints actions like create and update', function (done) {
expect(_.find(actual['/user'].post.parameters, {name: 'body', in: 'body'})).to.be.an('object');
expect(_.find(actual['/user/{id}'].put.parameters, {name: 'body', in: 'body'})).to.be.an('object');
Expand Down

0 comments on commit c321bd9

Please sign in to comment.