Skip to content

Instantly share code, notes, and snippets.

@kristianmandrup
Created February 21, 2010 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristianmandrup/310052 to your computer and use it in GitHub Desktop.
Save kristianmandrup/310052 to your computer and use it in GitHub Desktop.
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