Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
annyhe committed Feb 17, 2017
1 parent 3bf136b commit 4a961af
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
6 changes: 1 addition & 5 deletions api/v1/controllers/subjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,7 @@ module.exports = {
// Filter Parameter Validation
for (let i = 0; i < filterParams.length; i++) {
if (params[filterParams[i]].value) {




(params[filterParams[i]].value.split(','));
validateFilterParams(params[filterParams[i]].value.split(','));
}
}

Expand Down
10 changes: 10 additions & 0 deletions api/v1/controllers/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/**
* Copyright (c) 2016, salesforce.com, inc.
* All rights reserved.
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or
* https://opensource.org/licenses/BSD-3-Clause
*/

/**
* api/v1/controllers/utils.js
*/
const ZERO = 0;
const ONE = 1;

Expand Down
2 changes: 1 addition & 1 deletion api/v1/helpers/verbs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* api/v1/controllers/utils.js
* api/v1/helpers/verbs/utils.js
*/
'use strict';

Expand Down
20 changes: 8 additions & 12 deletions tests/api/v1/subjects/getHierarchyAspectAndTagsFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,13 @@ describe(`api: GET ${path}:`, () => {
api.get(endpoint)
.set('Authorization', token)
.expect(constants.httpStatus.BAD_REQUEST)
.expect((res) => {
expect(res.body.errors[0].type).to
.equal('InvalidFilterParameterError');
})
.end((err /* , res */) => {
.end((err, res ) => {
if (err) {
return done(err);
}

expect(res.body.errors[0].type).to
.equal('InvalidFilterParameterError');
done();
});
});
Expand Down Expand Up @@ -374,7 +372,11 @@ describe(`api: GET ${path}:`, () => {
api.get(endpoint2)
.set('Authorization', token)
.expect(constants.httpStatus.OK)
.expect((res) => {
.end((err, res ) => {
if (err) {
return done(err);
}

expect(res.body).to.not.equal(null);
expect(res.body.samples).to.have.length(2);
expect(res.body.samples[1]).to.have.deep
Expand All @@ -384,12 +386,6 @@ describe(`api: GET ${path}:`, () => {
expect(res.body.children[0].children).to.have.length(0);
expect(res.body.children[0].samples[0]).to.have.deep
.property('aspect.name', 'humidity');
})
.end((err /* , res */) => {
if (err) {
return done(err);
}

done();
});
});
Expand Down

0 comments on commit 4a961af

Please sign in to comment.