1

I have the vcr and webmock gems installed.

features/support/vcr_setup.rb:

require 'vcr'

VCR.configure do |c|
  c.cassette_library_dir = 'vcr_cassettes'
  c.hook_into :webmock
end

features/step_definitions/user.rb:

VCR.use_cassette('login to shopify') do
  Given /^I am a logged in user$/ do
    @shop = create(:shop)
    visit root_path
    fill_in :shop, :with => @shop.shopify_domain
    click_button 'Install'
    expect(page).to have_content("We'll automatically")
  end
end

When I run my suite, I'm getting the alert that I am making an HTTP request. Which step am I missing to properly record the first cassette so that I can re-use for future tests?

Jackson Cunningham
  • 4,973
  • 3
  • 30
  • 80

1 Answers1

0

Try to specify the absolute path of your cassette_library_dir configuration. Like this:

  c.cassette_library_dir = Rails.root.join('test', 'fixtures', 'vcr_cassettes')

(Whatever the correct path for vcr_cassettes is in your application)

So, your features/support/vcr_setup.rb becomes like this:

VCR.configure do |c|
  c.cassette_library_dir = Rails.root.join('test', 'fixtures', 'vcr_cassettes')
  c.hook_into :webmock
end
K M Rakibul Islam
  • 33,760
  • 12
  • 89
  • 110