Today I had to add a parameter to a request we were sending to an external API.
My unit test passed ✅ The acceptance specs did not - I had 20 failures. ❌
The failures were super cryptic, something about not being able to merge Nil:NilClass into a hash or something weirdly unrelated. One of my colleagues suspected it was to do with the VCR gem we used to simulate HTTP requests/responses from APIs.
Turns out VCR uses query strings as the key for the cassette (I did not know this). Because I'd added a param to the query string, the existing string (in the cassettes) was broken.