Monday, May 09, 2016

Preserving Exact Body Bytes in VCR

1. If you look at the VCR cassettes, you can see the response in JSON or Base64 encoded response.
2. Copy the Base64 encoded response and decode it using online Base64 decoder.
3. The result can be pasted on online JSON formatter and you will the JSON response.

Why does VCR do this for some requests?
What is the use of knowing this fact?

If you are having difficulty in making a test pass. You can change the string to a known input by encoding the known output for a given input in the VCR fixture file. This will make the test pass.

No comments:

Post a Comment