Skip to content

Commit

Permalink
Modifying JSON request test
Browse files Browse the repository at this point in the history
Modified JSON request tests so the same value sent in the request
is echoed in the test server JSON response.
  • Loading branch information
apoco committed Dec 2, 2014
1 parent a3dd3f8 commit ce70514
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/server.js
Expand Up @@ -89,7 +89,7 @@ exports.createPostJSONValidator = function (value, reqContentType) {
assert.ok(~req.headers['content-type'].indexOf(reqContentType))
}
resp.writeHead(200, {'content-type':'application/json'})
resp.write(JSON.stringify({ status: 'OK', value: parsedValue }))
resp.write(r)
resp.end()
})
}
Expand Down
4 changes: 2 additions & 2 deletions tests/test-json-request.js
Expand Up @@ -25,8 +25,8 @@ function testJSONValue(testId, value) {
}
request(opts, function (err, resp, body) {
t.equal(err, null)
t.equal(body.status, 'OK')
t.deepEqual(body.value, value)
t.equal(resp.statusCode, 200)
t.deepEqual(body, value)
t.end()
})
})
Expand Down

0 comments on commit ce70514

Please sign in to comment.