I have capybara feature specs I intend running without explicitly specifying a cassette name. E.g:
scenario "by searching via a title" do
visit root_path
fill_in "search", with: "cheddar"
find(".search-btn").click
expect(page).to have_content(/White Cheddar/)
end
scenario "by searching via a description" do
visit root_path
fill_in "search", with: "cheddar"
select "Description", from: "search_field"
find(".search-btn").click
expect(page).to have_content(/White Cheddars Are Scarce/)
end
Each of these specs goes out to hit a third party API. I want to use a different cassette name for each of these specs without having to explicitly use VCR.use_cassette
. I want my feature specs to be clear and concise enough just focusing on the user's action. Is there a way to achieve this?