using rspec with the default driver is working fine and all tests are passed.
changing driver: :webkit will have a bad side-effect.
- step: the user is logged in
- step: visiting root_path with a session (current_user)
- step: visiting root_path without a session (current_user = nil)
so either after the first visit root_path or before the second, the session is killed or whatever - we can't get the user to stay logged in.
test looks like this
scenario 'something', driver: :webkit do
user = FactoryGirl.create :user
login_as(user)
visit root_path
visit root_path
end
is this a known bug? are there any workarounds or are we missing something ?
as requested:
def login_as(user)
visit root_path
click_on "Login"
fill_in "user[login]", with: user.username
fill_in "user[password]", with: user.password
click_on "Sign in"
end
visit root_paththe first time and then saysave_and_opeÇıim defenitely logged in. also the login-specs (using exactly the same method and then expecting some code on the page to make sure the login is working) is green. as i said before, with the default webdriver all tests are green. if we switch to webkit, they are losing session/or/cookie - Tim Kretschmer