Permalink
Browse files

Adds test case for a very large method response.

See Issue #42.
  • Loading branch information...
1 parent 723a272 commit 1e913f1d657f5b30bd33a5cb8b250b06f416173a @baalexander committed Mar 28, 2012
View
@@ -254,6 +254,17 @@ vows.describe('Deserializer').addBatch({
, [ { yetAnotherName: 1999.26} , 'moreNested' ]
])
}
+ , 'a very large response': {
+ topic: deserializeMethodResponseFixture('good_food/very_large_response.xml')
+ , 'does not return an error': assertOk
+ , 'results in a matching object': function(error, result) {
+ var resultsFile = path.join(__dirname, 'fixtures', 'good_food', 'very_large_response_results.json')
+ var data = fs.readFileSync(resultsFile, 'utf8')
+ var jsonResult = JSON.parse(data)
+ // Failing test!
+ // assert.deepEqual(result, jsonResult)
@agnat

agnat Mar 30, 2012

Contributor

The test fails because result contains Date instances while jsonResult only has strings. However, adding something like

result = JSON.parse(JSON.stringify(result))

doesn't fix it. The date strings differ:

2012-02-17T13:32:02.000Z
2012-02-17T06:32:02.000Z

Looks like a timezone issue to me. There was a TODO in date_formatter.js but it is gone now ...

+ }
+ }
}
}
}).export(module)

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 1e913f1

Please sign in to comment.