Skip to content

Commit

Permalink
Test conditional GET support for ?metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Nov 11, 2016
1 parent 14ce691 commit d15f15f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/processImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,11 @@ describe('express-processimage', function () {
});
});

it('should allow retrieving the image metadata as JSON', function () {
it('should allow retrieving the image metadata as JSON and support conditional GET', function () {
return expect('GET /turtle.jpg?metadata', 'to yield response', {
headers: {
ETag: expect.it('to be a string')
},
body: {
contentType: 'image/jpeg',
filesize: 105836,
Expand All @@ -401,6 +404,13 @@ describe('express-processimage', function () {
hasProfile: false,
hasAlpha: false
}
}).then(function (context) {
return expect({
url: 'GET /turtle.jpg?metadata',
headers: {
'If-None-Match': context.httpResponse.headers.get('ETag')
}
}, 'to yield response', 304);
});
});

Expand Down

0 comments on commit d15f15f

Please sign in to comment.