jnicklas/capybara — Issue #567: Javascript firing twice on each request
Author: chaffeqa
Created: 2011-12-14 19:00:28+00:00
State: open

i know this is a nightmare of a debug... but I thought i may as well report it since i cannot for the life of me figure it out:

I am running a rails 2 integration test suite which switches User Agents (creating a new selenium driver)

It goes something like this:

~~~ruby
describe "a logged in user"
before(:each) {create_a_user}
describe "when in his roster (using an iPhone)" do
before(:each) {
Capybara.current_driver = :iphone
login
}
# test
end
end
~~~

with initializer:

~~~ruby
Capybara.register_driver :iphone do |app|
require 'selenium/webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile['general.useragent.override'] = "iPhone"
Capybara::Selenium::Driver.new(app, :profile => profile)
end
~~~

and inline javascript calls on each request are getting fired twice.

I am at a loss for why that is, any ideas?