I'm attempting to do RSpec feature tests on an external API.
My VCR config is as follows:
VCR.configure do |config|
config.cassette_library_dir = 'spec/vcr'
config.hook_into :webmock
config.ignore_localhost = true
end
My test looks like this:
feature 'Visitor' do
scenario 'performs an archival', :clean => false, :js => true do
mock_login
visit '/dashboard'
click_link 'Test Company'
VCR.use_cassette('feature/archive') do
within '.nav-app' do
click_button 'Quicksave'
end
end
end
scenario 'performs a restore', :js => true do
mock_login
visit '/dashboard'
click_link 'Test Company'
VCR.use_cassette('feature/restore') do
within '.nav-app' do
click_button 'Quickload'
end
end
end
end
The archive
cassette is created just fine, however the restore
cassette throws an error:
An HTTP request has been made that VCR does not know how to handle:
GET http://SomeApiUrl/...
There is currently no cassette in use.
I've obviously told VCR to create and use another cassette with:
VCR.use_cassette('feature/restore')
So what gives?
It's also worth mentioning that I still receive this error even when I clean out my cassette folder and start fresh.