Search code examples
ruby-on-railsrubytestingrspecvcr

Is it correct to store vcr cassettes in repository?


I develop a Ruby interface for one REST api. I use rspec and vcr for testing.
All tests use credentials of account, specially created for it.
I can't decide: is it correct to store cached responses of my tests(vcr cassettes) in repository, or allow users and subscribers to write their own cassettes?

By the name of the Emperor! Let the Holy War begins!


Solution

  • As long as you aren't including any sensitive information in the requests then I see no reason why you can't commit them.

    But as long as it will work fine after first test seeding the cassettes there isn't too much at stake either way.

    Personally I like the idea of being checked against historical requests in case I have to diagnose some obscure machine-specific error changing my request formats. (IE some encoding bug where things are being escaped incorrectly due to a dynamically loaded library).