Skip to content

Commit

Permalink
added a few more unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
supernomad committed Jun 21, 2015
1 parent 1dadc48 commit 2535902
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/routes/chunked-download-routes-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,35 @@ describe("chunked-upload-routes.js", function() {
});
});

it('should throw a DownloadMissing error if the supplied downloadId does not exist', function() {
cache_mock.setReturnValue(false);
(function() {
routes.get.handler({
params: {
downloadId: guidHelper.newGuid(),
index: 0
}
}, {
send: function(buffer) {
}
});
}).should.throw(errorModels.GenericError);
});

it('should throw a DownloadMissing error if the supplied downloadId does not exist', function() {
(function() {
routes.get.handler({
params: {
downloadId: guidHelper.newGuid(),
index: 0
}
}, {
send: function(buffer) {
}
});
}).should.throw(errorModels.GenericError);
});

it('should throw a ValidationError if the supplied downloadId is not a valid v4 GUID', function() {
(function() {
routes.get.handler({
Expand Down

0 comments on commit 2535902

Please sign in to comment.