Created
February 21, 2010 01:55
-
-
Save kristianmandrup/310052 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/rails' | |
require 'capybara/cucumber' | |
require 'capybara/session' | |
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript | |
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In | |
# order to ease the transition to Capybara we set the default here. If you'd | |
# prefer to use XPath just remove this line and adjust any selectors in your | |
# steps to use the XPath syntax. | |
Capybara.default_selector = :css | |
# From: http://github.com/jnicklas/capybara/issues#issue/46 | |
require 'capybara/dsl' | |
Capybara.app = <%= application_name %>::Application | |
module <%= application_name %> | |
class IntegrationTest | |
include Capybara | |
end | |
end | |
--- | |
The application_name is set inside the generator using this logic: | |
@application_name = /module\s*(\S*)\s*class/.match(IO.read('config/application.rb'))[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment