I use RSpec-Rails 2.6.1 together with Capybara 1.0.0.
Whenever I start my integration (request) tests I get the following
error:
Failure/Error: page.execute_script(’$
(“div.editable:first”).trigger(“mouseover”);’)
Selenium::WebDriver::Error::UnexpectedJavascriptError:
$ is not defined
It seems that it can’t find jQuery in there. Another strange thing is
that it doesn’t start the browser at all when telling Capybara to use
the Selenium driver.
Why do I write this here!? Because when I switch back to RSpec 2.5
everything runs fine again. Do I have to re-configure something for
RSpec 2.6? Any clue what the cause could be?
config.after(:each) do
DatabaseCleaner.clean
Sunspot.remove_all!
end
end
Webrat.configure do |config|
config.mode = :rails
end
Webrat and Capybara are not compatible, as they each do similar things
in different ways. This wasn’t a visible issue in rspec-rails-2.5
because capybara was only mixed in to request specs, but 2.6 mixes it
into view and helper specs as well.