0

So the following code works in isolation but if I run the full test suite it breaks if I remove:

Capybara.reset_sessions!

From my investigation the user can't sign in as they are already signed in. So my question is, is it typical to need to call this before running new session tests? And if so, is there somewhere common I can put this so I don't need to have it in every setup method of tests?

require 'test_helper'

class SignInTest < ActionDispatch::IntegrationTest
  def setup
    Capybara.reset_sessions!
  end

  test 'user can sign in' do

  end
end
Brettski
  • 1,061
  • 2
  • 12
  • 25

1 Answers1

0

Add this to:

test_helper.rb 

 

class ActionDispatch::IntegrationTest
  include Capybara::DSL
  Capybara.default_driver = :webkit

  def teardown
    Capybara.reset_sessions!
  end
end
Brettski
  • 1,061
  • 2
  • 12
  • 25