Skip to content

Commit

Permalink
Test post content-type header.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgraham committed Oct 13, 2014
1 parent 3bca288 commit d727332
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ asyncTest('resolves blob promise', 2, function() {
})
})

asyncTest('sends encoded post body', 2, function() {
asyncTest('post sends encoded body', 2, function() {
fetch('/hello', {
method: 'post',
body: {
Expand All @@ -93,3 +93,14 @@ asyncTest('sends encoded post body', 2, function() {
start()
})
})

asyncTest('post sets content-type header', 1, function() {
fetch('/hello', {
method: 'post',
body: {}
}).then(function(response) {
var request = MockXHR.last()
equal(request.headers['Content-Type'], 'application/x-www-form-urlencoded; charset=UTF-8')
start()
})
})

0 comments on commit d727332

Please sign in to comment.