Skip to content

Commit

Permalink
update compare result to body
Browse files Browse the repository at this point in the history
  • Loading branch information
ArvoGuo committed Sep 22, 2014
1 parent c07ecf2 commit acdaf32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"/prize/ajax/prizeDraw?groupId=198": {
"code": 200,
"msg": {}
},
},
"/test": {
"code": 200,
"msg": "hello world!"
Expand Down
5 changes: 4 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ describe('Routes', function() {
})
it('should get the request in config.json ', function(done) {
request.get('http://localhost:3000/prize/ajax/prizeDraw?groupId=198', function(err,res, body) {
assert(config.ajaxList[res.req.path])
var path = res.req.path;
var result = config.ajaxList[path];
var res_body = JSON.parse(body);
assert.deepEqual(result,res_body)
done();
});
})
Expand Down

0 comments on commit acdaf32

Please sign in to comment.