diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb index 7f90f54c1..c24066e79 100644 --- a/spec/features/home_spec.rb +++ b/spec/features/home_spec.rb @@ -112,7 +112,7 @@ feature "Home" do end feature 'IE alert' do - scenario 'IE visitors are presented with an alert until they close it' do + scenario 'IE visitors are presented with an alert until they close it', :page_driver do # Selenium API does not include page request/response inspection methods # so we must use Capybara::RackTest driver to set the browser's headers Capybara.current_session.driver.header( @@ -133,7 +133,7 @@ feature "Home" do expect(page.driver.request.cookies['ie_alert_closed']).to eq('true') end - scenario 'non-IE visitors are not bothered with IE alerts' do + scenario 'non-IE visitors are not bothered with IE alerts', :page_driver do visit root_path expect(page).not_to have_xpath(ie_alert_box_xpath, visible: false) expect(page.driver.request.cookies['ie_alert_closed']).to be_nil diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d845190ed..98ffd6f31 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -60,6 +60,10 @@ RSpec.configure do |config| end end + config.after(:each, :page_driver) do + page.driver.reset! + end + config.before(:each, type: :feature) do Capybara.reset_sessions! end