I use rspec / capybara in my rails project for tests, which works fine with the default driver. But when I switch to webkit or selenium, I log out after every request that I make. This code works as expected, I see that the logged in page twice:
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 install webkit or selenium as a driver, only the first page is the registered version, on the second page I log 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?
source
share