venmo / DVR

Network testing for Swift
http://blog.soff.es/network-testing-in-swift-with-dvr
MIT License
651 stars 86 forks source link

Nil interaction.responseData for certain content-types #21

Closed ksm closed 9 years ago

ksm commented 9 years ago

Just upgraded to DVR v0.1 and migrated my JSON cassettes using the convert.rb script. Tests started failing because I was not getting JSON data (just a response).

I believe the culprit is https://github.com/venmo/DVR/blob/master/DVR/Interaction.swift#L58.

DVR checks for contentType == "application/json", but the Content-Type header field can contain more than that. In my case it is application/json; charset=utf-8.

Was gonna submit a pull request, but the project refuses to run tests for me due to some Xcode 7 beta 5 silliness: seeing dozens of devices in my device list, then when I choose one and try to run tests from test navigator it says the device is not valid for tests. Building for tests leads to symbol not found errors. :\

One more thing: thank you for DVR. Really liking how it makes a whole category of tests in my app feasible. :sparkling_heart:

soffes commented 9 years ago

We should switch that to check for the that as a prefix. Good call!

soffes commented 9 years ago

Released version 0.1.1 with this fix.