Skip to content

Commit

Permalink
add tests for missing @latest
Browse files Browse the repository at this point in the history
  • Loading branch information
TakenPilot committed Jan 13, 2016
1 parent 668e0f2 commit 986793f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/api/components/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ describe(endpointName, function () {

// published blank data will publish @latest
acceptsJsonBody(path, {name: 'valid', version: version, id: 'valid'}, {}, 200, data);
// publishing blank data without a @latest will 404 because missing resource
acceptsJsonBody(path, {name: 'valid', version: version, id: 'missing'}, {}, 404, { code: 404, message: 'Not Found' });

// block with _ref at root of object
acceptsJsonBody(path, {name: 'valid', version: version, id: 'valid'}, _.assign({_ref: 'whatever'}, data), 400, {message: 'Reference (_ref) at root of object is not acceptable', code: 400});
Expand Down
1 change: 1 addition & 0 deletions test/api/pages/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe(endpointName, function () {

// published blank data will publish @latest
acceptsJsonBody(path, {name: 'valid', version: version}, {}, 200, versionedPageData(version));
acceptsJsonBody(path, {name: 'missing', version: version}, {}, 404, { code: 404, message: 'Not Found'});

// block with _ref at root of object
acceptsJsonBody(path, {name: 'valid', version: version}, _.assign({_ref: 'whatever'}, pageData), 400, {message: 'Reference (_ref) at root of object is not acceptable', code: 400});
Expand Down

0 comments on commit 986793f

Please sign in to comment.