2

I'm using the VCR gem that records lots of http requests and saves them as fixtures in fixtures/vcr_cassettes.

It works fine locally, but it seems that when I deploy on Heroku, the fixtures is not used and the tests uses real http requests, which is not the behavior intended.

My question is : Is there a special configuration in "app.json" or else that I need to add to ask my CI to run the fixtures instead of real http requests?

app.json

"environments": {
    "test": {
      "env": {
..........
      },
      "addons": ["heroku-postgresql:in-dyno", "heroku-redis:in-dyno"],
      "scripts":
        {
          "test-setup": "bundle exec rake db:seed",
          "test": "bundle exec rspec" 
        }
    } 

spec_helper.rb

VCR.configure do |config|
  config.cassette_library_dir = "./fixtures/vcr_cassettes"
  config.hook_into :webmock
  config.allow_http_connections_when_no_cassette = true
end
Segrelove
  • 19
  • 3

0 Answers0