I'm found an interesting problem in my app.
I'm using Rails 3 with ruby 2.0. I already have a production server where my app is running and another staging server. I'm configuring a new better one but I have a problem only with Safari.
Redirected to http://ip.server/
Completed 302 Found in 201.7ms (ActiveRecord: 0.0ms)
Started GET "/" for my.ip at 2014-10-13 08:17:18 +0200
Processing by DashboardController#index as HTML
Completed 401 Unauthorized in 1.2ms
Started GET "/user/sign_in" for my.ip at 2014-10-13 08:17:18 +0200
Processing by Devise::SessionsController#new as HTML
Rendered application/_field_errors.html.erb (0.0ms)
Rendered application/_field_errors.html.erb (0.0ms)
Rendered devise/sessions/new.html.erb within layouts/devise (2.3ms)
Completed 200 OK in 5.5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
When I check on the network tab, I can see this:
Fail to load resource: the server responded with a status of 401 (unauthorized)
At the beginning I thought my problem came from Devise but then I checked on Google and find that:
cross browser problem
I tried on Chrome and it works. I tried also without AdBlock or with the private navigation but it still not working with Safari.
Edit:
I did 2 requests, one coming from Chrome and the second one from Safari. The only difference is this line:
WARNING: Can't verify CSRF token authenticity
Edit 2:
I've commented the line protect_from_forgery on my ApplicationController.rb and finally this error (about CSRF) wasn't responsible for my problem.
Here my stacks when I try with Chrome and with Safari.
With Chrome:
Started POST "/user/sign_in" for my.ip at 2014-10-14 13:27:51 +0200
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"c86MNR4MCSbQWJiAjkGtgfgPMg5YirG1tqf/2vqdBWc=", "user"=>{"email"=>"test#example.com", "password"=>"[FILTERED]", "remember_me"=>"0"}}
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'test#example.com' LIMIT 1
(0.1ms) BEGIN
WARNING: User#current is nil, are you including SentientController on your ApplicationController?
(0.3ms) UPDATE `users` SET `last_sign_in_at` = '2014-10-14 11:26:45', `current_sign_in_at` = '2014-10-14 11:27:51', `sign_in_count` = 52, `updated_at` = '2014-10-14 11:27:51' WHERE `users`.`type` IN ('User::Admin') AND `users`.`id` = 1
(26.1ms) COMMIT
Redirected to http://server.ip/
Completed 302 Found in 135.6ms (ActiveRecord: 0.0ms)
Started GET "/" for my.ip at 2014-10-14 13:27:51 +0200
Processing by DashboardController#index as HTML
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
server.ip Rendered dashboard/index.html.erb within layouts/application (2.5ms)
Rendered application/_header.html.slim (57.6ms)
Rendered application/_sidebar.html.erb (48.1ms)
Rendered application/_page_header.html.slim (2.0ms)
Rendered application/_flash_messages.html.erb (0.5ms)
Rendered application/_footer.html.erb (0.8ms)
Completed 200 OK in 137.5ms (Views: 122.9ms | ActiveRecord: 5.1ms)
With Safari:
Started POST "/user/sign_in" for my.ip at 2014-10-14 13:27:58 +0200
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"TWKhSxus5q46H9sZdEvMnzD52r0zA5phw/Pv7K+NKuY=", "user"=>{"email"=>"test#example.com", "password"=>"[FILTERED]", "remember_me"=>"0"}}
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'test#example.com' LIMIT 1
(0.1ms) BEGIN
(0.3ms) UPDATE `users` SET `last_sign_in_at` = '2014-10-14 11:27:51', `current_sign_in_at` = '2014-10-14 11:27:58', `sign_in_count` = 53, `updated_at` = '2014-10-14 11:27:58' WHERE `users`.`type` IN ('User::Admin') AND `users`.`id` = 1
(24.8ms) COMMIT
Redirected to http://server.ip/
Completed 302 Found in 138.2ms (ActiveRecord: 0.0ms)
Started GET "/" for my.ip at 2014-10-14 13:27:58 +0200
Processing by DashboardController#index as HTML
Completed 401 Unauthorized in 1.2ms
Started GET "/user/sign_in" for my.ip at 2014-10-14 13:27:58 +0200
Processing by Devise::SessionsController#new as HTML
Rendered application/_field_errors.html.erb (0.0ms)
Rendered application/_field_errors.html.erb (0.0ms)
Rendered devise/sessions/new.html.erb within layouts/devise (2.2ms)
Completed 200 OK in 5.2ms (Views: 3.7ms | ActiveRecord: 0.0ms)
Problem solved. It was not at all coming from my app but from my DNS redirection. I put an simple web redirection for tests and I forgot to add DNS redirection.
Now everything is working perfectly.
I hope this will help someone else!
Related
I'm using Capybara 2.13.0 and I've got a test that relies on an Ajax request adding dynamic content into the DOM.
test 'contact data becomes visible when providing the correct password' do
login_as_researcher
visit '/participants/3'
assert page.has_css?("ul#redacted-contact-data")
click_button('Unlock Contact Data')
# Use the correct password
fill_in('enter your password', with: 'password1')
# Ajax happens here. It renders a partial and places it in the dom.
click_button('Submit')
# Test sometimes fails here..
assert page.has_css?("ul#contact-data"), -> { page.body }
end
I've read a lot of articles that say Capybara automatically waits for elements to appear in the HTML and there's no need to manually tell Capybara to wait anymore, but I'm not experiencing this in my case.
75% of the time this test passes and when it does fail and the page is dumped, it contains the content of the partial rendered in the JS response instead of the full HTML page.
Any idea what's going on here? I can only assume it's due to how long it takes the server to respond the Ajax request each time and Capybara not waiting long enough in certain situations.
I've set Capybara.default_max_wait_time = 5 in my test_helper.
I've tried with both the selenium and poltergeist drivers and it makes no difference.
Here's the output from test.log
Started GET "/" for 127.0.0.1 at 2017-05-01 18:09:23 +0100
Processing by HomeController#index as HTML
Researcher Load (0.3ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."id" IS NULL LIMIT 1
Redirected to http://www.example.com/session/new
Filter chain halted as :researcher_only rendered or redirected
Completed 302 Found in 30ms (ActiveRecord: 0.3ms)
Started GET "/session/new" for 127.0.0.1 at 2017-05-01 18:09:23 +0100
Processing by SessionsController#new as HTML
Rendered sessions/new.html.erb within layouts/application (9.5ms)
Researcher Load (0.1ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."id" IS NULL LIMIT 1
Completed 200 OK in 248ms (Views: 247.6ms | ActiveRecord: 0.1ms)
Started POST "/session" for 127.0.0.1 at 2017-05-01 18:09:23 +0100
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "username"=>"nick1", "password"=>"[FILTERED]", "commit"=>"Enter"}
Researcher Load (0.1ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."username" = ? LIMIT 1 [["username", "nick1"]]
Redirected to http://www.example.com/
Completed 302 Found in 78ms (ActiveRecord: 0.1ms)
Started GET "/" for 127.0.0.1 at 2017-05-01 18:09:23 +0100
Processing by HomeController#index as HTML
Researcher Load (0.1ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."id" = ? LIMIT 1 [["id", 2]]
Rendered home/index.html.erb within layouts/application (0.6ms)
Completed 200 OK in 10ms (Views: 8.6ms | ActiveRecord: 0.1ms)
Started GET "/participants/3" for 127.0.0.1 at 2017-05-01 18:09:23 +0100
Processing by ParticipantsController#show as HTML
Parameters: {"id"=>"3"}
Participant Load (1.9ms) SELECT "participants".* FROM "participants" WHERE "participants"."id" = ? LIMIT 1 [["id", 3]]
Researcher Load (0.1ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."id" = ? LIMIT 1 [["id", 2]]
ContactData Load (0.2ms) SELECT "contact_data".* FROM "contact_data" WHERE "contact_data"."participant_id" = ? LIMIT 1 [["participant_id", 3]]
AlcoholService Load (0.1ms) SELECT "alcohol_services".* FROM "alcohol_services" WHERE "alcohol_services"."id" = ? LIMIT 1 [["id", 16]]
Baseline Load (0.3ms) SELECT "baselines".* FROM "baselines" WHERE "baselines"."participant_id" = ? LIMIT 1 [["participant_id", 3]]
Rendered participants/_unlock_contact_data.html.erb (1.1ms)
Rendered participants/_details.html.erb (52.8ms)
Rendered participants/show.html.erb within layouts/application (58.8ms)
Completed 200 OK in 94ms (Views: 69.9ms | ActiveRecord: 3.0ms)
Started POST "/participants/unlock_contact_data?participant_id=3" for 127.0.0.1 at 2017-05-01 18:09:24 +0100
Processing by ParticipantsController#unlock_contact_data as JS
Parameters: {"utf8"=>"✓", "from"=>"show", "password"=>"[FILTERED]", "commit"=>"Submit", "participant_id"=>"3"}
Researcher Load (0.1ms) SELECT "researchers".* FROM "researchers" WHERE "researchers"."id" = ? LIMIT 1 [["id", 2]]
Participant Load (0.0ms) SELECT "participants".* FROM "participants" WHERE "participants"."id" = ? LIMIT 1 [["id", 3]]
ContactData Load (0.1ms) SELECT "contact_data".* FROM "contact_data" WHERE "contact_data"."participant_id" = ? LIMIT 1 [["participant_id", 3]]
AlcoholService Load (0.1ms) SELECT "alcohol_services".* FROM "alcohol_services" WHERE "alcohol_services"."id" = ? LIMIT 1 [["id", 16]]
Baseline Load (0.0ms) SELECT "baselines".* FROM "baselines" WHERE "baselines"."participant_id" = ? LIMIT 1 [["participant_id", 3]]
Rendered participants/_details.html.erb (4.6ms)
Rendered participants/unlock_contact_data.js.erb (6.7ms)
Completed 200 OK in 81ms (Views: 10.8ms | ActiveRecord: 0.3ms)
(0.1ms) rollback transaction
(0.1ms) begin transaction
Is there anything I might be missing?
I'm using rails 3.2 and Devise 3.4.1.
On development environment all is working great but on production I'm getting this:
Started POST "/users/sign_in" for 111.111.111.11 at 2015-01-18 15:04:58 +0000
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"PGRrSKfVz8fZiv1a1qBJN2TzmFRAvUgEfYRpmdWiPWk=", "user"=>{"email"=>"email#email.com", "password"=>"[FILTERED]"}, "commit"=>"Log in"}
User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`email` = 'email#email.com' LIMIT 1
(0.2ms) BEGIN
(0.5ms) UPDATE `users` SET `last_sign_in_at` = '2015-01-18 15:04:53', `current_sign_in_at` = '2015-01-18 15:04:59', `sign_in_count` = 25, `updated_at` = '2015-01-18 15:04:59' WHERE `users`.`id` = 2
(1.2ms) COMMIT
Redirected to http://subdomain.domain.com/
Completed 302 Found in 100.0ms (ActiveRecord: 0.0ms)
Started GET "/" for 111.111.111.11 at 2015-01-18 15:04:59 +0000
Started GET "/authorized" for 111.111.111.11 at 2015-01-18 15:04:59 +0000
Processing by AuthorizedController#index as HTML
Completed 401 Unauthorized in 0.3ms
Started GET "/users/sign_in" for 111.111.111.11 at 2015-01-18 15:05:00 +0000
Processing by SessionsController#new as HTML
Rendered devise/shared/_links.html.erb (0.1ms)
Rendered devise/sessions/new.html.erb (4.0ms)
Completed 200 OK in 5.3ms (Views: 4.5ms | ActiveRecord: 0.0ms)
as you can see the user is being authorised but signing out immediately after that.
help?
well, the CDN just blocked Devise's cookie so it's solved now
thank you all!
I configure Devise gem for Rails and in code it seems look OK but when I'm trying to register new user I have the problem.
In register form Devise show notice:
Please review the problems below:
but that's all. Nothing specific message. Where I should looking for first? How to debug something like this?
Any suggestions?
Log from rails server:
Started POST "/auth/register" for 127.0.0.1 at 2014-09-14 17:09:13
+0200 Processing by Devise::RegistrationsController#create as HTML Parameters: {"utf8"=>"✓",
"authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=",
"user"=>{"email"=>"test#test.com", "password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
(0.2ms) BEGIN User Exists (0.4ms) SELECT 1 AS one FROM "users"
WHERE "users"."email" = 'test#test.com' LIMIT 1 (0.2ms) ROLLBACK
Rendered devise/shared/_links.haml (0.5ms) Rendered
devise/registrations/new.html.haml within layouts/application (15.9ms)
Completed 200 OK in 121ms (Views: 24.2ms | ActiveRecord: 0.8ms)
And when I try log in:
Started POST "/auth/login" for 127.0.0.1 at 2014-09-14 17:10:23 +0200
Processing by Devise::SessionsController#create as HTML Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=",
"user"=>{"email"=>"test#test.com", "password"=>"[FILTERED]",
"remember_me"=>"0"}, "commit"=>"Sign in"} User Load (0.7ms) SELECT
"users".* FROM "users" WHERE "users"."email" = 'test#test.com' ORDER
BY "users"."id" ASC LIMIT 1 Completed 401 Unauthorized in 2ms
Processing by Devise::SessionsController#new as HTML Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"iRsLU68tBckSzK1tupMoXZQlGw7xOuzMlfuiIVVs+rc=",
"user"=>{"email"=>"test#test.com", "password"=>"[FILTERED]",
"remember_me"=>"0"}, "commit"=>"Sign in"} Rendered
devise/shared/_links.haml (0.4ms) Rendered
devise/sessions/new.html.haml within layouts/application (9.8ms)
Completed 200 OK in 106ms (Views: 15.4ms | ActiveRecord: 0.0ms)
I debug these things by inspecting the object.errors
In this case, try to
raise #user.errors.inspect
Somewhere after the save in the create method
Devise is acting weird for the first time each day when a User tries to create a new User in our project. This is the server log from the exact moment the user clicks on the confirm link:
Started GET "/users/confirmation?confirmation_token=3F367iMzUm5y3ohbkykM" for 199.116.169.254 at 2014-07-22 15:34:29 +0000
Processing by Devise::ConfirmationsController#show as */*
Parameters: {"confirmation_token"=>"3F367iMzUm5y3ohbkykM"}
Redirected to http://qa.nearshoreconnect.com/users/sign_in
Completed 302 Found in 228ms (ActiveRecord: 2.2ms)
Started GET "/users/sign_in" for 199.116.169.254 at 2014-07-22 15:34:29 +0000
Processing by Devise::SessionsController#new as */*
Rendered layouts/_errors.html.erb (0.1ms)
Rendered devise/sessions/new.html.erb within layouts/application (6.1ms)
Rendered layouts/_shim.html.erb (0.4ms)
Rendered layouts/_search_box.html.erb (1.2ms)
Rendered layouts/_header_internet.html.erb (9.6ms)
Rendered layouts/_footer_internet.html.erb (1.4ms)
Completed 200 OK in 29ms (Views: 27.5ms | ActiveRecord: 0.0ms | Solr: 0.0ms)
Started GET "/users/confirmation?confirmation_token=3F367iMzUm5y3ohbkykM" for 201.234.55.21 at 2014-07-22 15:34:30 +0000
Processing by Devise::ConfirmationsController#show as HTML
Parameters: {"confirmation_token"=>"3F367iMzUm5y3ohbkykM"}
Rendered layouts/_errors.html.erb (0.7ms)
Rendered devise/confirmations/new.html.erb within layouts/application (3.9ms)
Rendered layouts/_shim.html.erb (0.4ms)
Rendered layouts/_search_box.html.erb (1.0ms)
Rendered layouts/_header_internet.html.erb (2.6ms)
Rendered layouts/_footer_internet.html.erb (1.3ms)
Completed 200 OK in 18ms (Views: 14.1ms | ActiveRecord: 0.3ms | Solr: 0.0ms)
Started GET "/assets/font.css" for 201.234.55.21 at 2014-07-22 15:34:30 +0000
Served asset /font.css - 304 Not Modified (0ms)
The validation token is checked twice. I'm overriding the confirm function in my User model. Is that the problem? The code:
def confirm!
super
send_welcome_mail
end
I have a simple login system that works in the browser. I recently switched my cucumber tests to use selenium because I need ajax calls and now the login/auth steps do not pass anymore. The app still functions normally in firefox and chromium.
Here are the Steps and the definitions
features/authentication.features
Feature: Require Authentication
In order to restrict access to the app
A User
Must be logged in
Scenario: Accessing Tracks
Given I am not logged in
And I visit the "Tracks" page
Then I should see the "Welcome" page
And I should see "You need to be logged in to access this page"
Scenario: Accessing Tracks when Logged in
Given I am logged in
And I visit the "Tracks" page
Then I should see the "Tracks" page
features/step_definitions/register_and_login_steps.rb
When(/^I log in as "(.*?)"$/) do |name|
create_and_login(name)
end
When(/^I log in$/) do
create_and_login('tester')
end
When(/^I log out$/) do
visit(logout_path)
end
When(/^I should be logged out$/) do
page.should have_title "Welcome"
page.should have_text "Please log in"
end
When(/^I am( not)? logged in$/) do |negative|
if negative
visit(logout_path)
else
create_and_login('anyone')
page.should have_title 'Welcome'
end
end
features/step_definitions/should_see_steps.rb
When(/I should( not)? see the "(.*?)" page$/) do |negative, page_title|
if negative
page.should_not have_title page_title
else
page.should have_title page_title
end
end
When(/^I should( not)? see "(.*?)"$/) do |negative, text|
if negative
page.should_not have_text text
else
page.should have_text text
end
end
When(/^I visit the "(.*?)" page$/) do |page|
path = page.downcase + "_path"
visit_path(path)
end
features/support/helpers/user.rb
def password_for(user)
user + '_password_'
end
def create_user(name)
return if User.exists?(name: name)
user = User.create!(name: name,
password: password_for(name),
password_confirmation: password_for(name))
end
def create_and_login(name)
create_user(name)
visit(logout_path)
visit(login_path)
fill_in 'Name', with: name
fill_in 'Password', with: password_for(name)
click_button 'Login'
end
Gemfile (test group only)
group :test do
gem 'guard-spork', '~> 1.5.0'
gem 'rb-inotify', '~> 0.9.0'
gem 'spork', '~> 0.9.2'
gem 'guard-rspec','~> 2.5.0'
gem 'cucumber-rails' , '~> 1.3.0'
gem 'database_cleaner','~> 0.9.1'
gem 'guard-cucumber', '~> 1.3.2'
gem 'capybara', '~> 2.1.0'
gem 'selenium-webdriver', '~>2.31.0'
end
log/test.log
Connecting to database specified by database.yml
(0.3ms) begin transaction
Started GET "/logout" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by SessionsController#destroy as HTML
Redirected to http://127.0.0.1:42286/login
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (26.4ms)
Rendered layouts/_player.html.haml (0.9ms)
Completed 200 OK in 64ms (Views: 63.6ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.js" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Served asset /application.js - 200 OK (8ms)
Started GET "/assets/application.css" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Served asset /application.css - 200 OK (3ms)
Started GET "/tracks" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by TracksController#index as HTML
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."session" = '' LIMIT 1
Redirected to http://127.0.0.1:42286/login
Filter chain halted as :require_login rendered or redirected
Completed 302 Found in 62ms (ActiveRecord: 1.6ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (1.8ms)
Rendered layouts/_player.html.haml (0.1ms)
Completed 200 OK in 4ms (Views: 3.8ms | ActiveRecord: 0.0ms)
(0.1ms) rollback transaction
(0.0ms) begin transaction
User Exists (1.1ms) SELECT 1 AS one FROM "users" WHERE "users"."name" = 'anyone' LIMIT 1
(0.0ms) SAVEPOINT active_record_1
User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."name" = 'anyone' LIMIT 1
User Exists (0.0ms) SELECT 1 AS one FROM "users" WHERE "users"."session" IS NULL LIMIT 1
Binary data inserted for `string` type on column `password_digest`
Binary data inserted for `string` type on column `session`
SQL (0.3ms) INSERT INTO "users" ("admin", "created_at", "name", "password_digest", "session", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["admin", nil], ["created_at", Sun, 21 Apr 2013 23:57:49 UTC +00:00], ["name", "anyone"], ["password_digest", "$2a$10$2kPN1wqnXI/G9b/1KMR2x.7yCHCaKwftE7PXm/q4u9Q9bcWCTenMG"], ["session", "91e2394dcdc86ada3836b258ad6bd2c850f99e03"], ["updated_at", Sun, 21 Apr 2013 23:57:49 UTC +00:00]]
(0.0ms) RELEASE SAVEPOINT active_record_1
Started GET "/logout" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by SessionsController#destroy as HTML
Redirected to http://127.0.0.1:42286/login
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:49 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (0.9ms)
Rendered layouts/_player.html.haml (0.0ms)
Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:50 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (0.9ms)
Rendered layouts/_player.html.haml (0.0ms)
Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
Started POST "/sessions" for 127.0.0.1 at 2013-04-22 01:57:50 +0200
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "session"=>{"name"=>"anyone", "password"=>"[FILTERED]"}, "commit"=>"Login"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'anyone' LIMIT 1
Redirected to http://127.0.0.1:42286/login
Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:50 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (0.8ms)
Rendered layouts/_player.html.haml (0.1ms)
Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
Started GET "/tracks" for 127.0.0.1 at 2013-04-22 01:57:50 +0200
Processing by TracksController#index as HTML
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."session" = '' LIMIT 1
Redirected to http://127.0.0.1:42286/login
Filter chain halted as :require_login rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.2ms)
Started GET "/login" for 127.0.0.1 at 2013-04-22 01:57:50 +0200
Processing by SessionsController#new as HTML
Rendered sessions/new.html.haml within layouts/application (27.5ms)
Rendered layouts/_player.html.haml (0.0ms)
Completed 200 OK in 29ms (Views: 28.9ms | ActiveRecord: 0.0ms)
(0.1ms) rollback transaction
The fix was to not set selenium as the default capybara driver and tag the tests that require ajax with #javascript.