i'm using rspec/capybara in my rails project for tests, which is working fine with the default driver. But when i switch to webkit or selenium i get logged out after every request that i make. This code is working as expected, i see the logged in page 2 times:
require 'rails_helper'
feature 'test' do
scenario 'this' do
user = FactoryGirl.create :user
login_as(user)
visit root_path
save_and_open_page
visit root_path
save_and_open_page
end
end
When i set webkit or selenium as driver only the first page is the logged in version, on the second page i'm logged out:
require 'rails_helper'
feature 'test' do
scenario 'this', driver: :webkit do
user = FactoryGirl.create :user
login_as(user)
visit root_path
save_and_open_page
visit root_path
save_and_open_page
end
end
How can i fix this?