update cucumber config for capybara

This commit is contained in:
Reinier Balt 2012-01-27 11:23:36 +01:00
parent dc0a141f1c
commit b874b49336
7 changed files with 167 additions and 219 deletions

View file

@ -13,14 +13,15 @@ require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'
require 'webrat'
require 'webrat/core/matchers'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end
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
# If you set this to false, any error raised from within your app will bubble
# up to your step definition and out to cucumber unless you catch it somewhere

View file

@ -9,7 +9,7 @@ module NavigationHelpers
options = @mobile_interface ? {:format => :m} : {}
options = {:locale => @locale}.merge(options) if @locale
@source_view = nil
case page_name
when /the home\s?page/
@ -109,12 +109,12 @@ module NavigationHelpers
tag_path($1, options)
when /the change password page/
change_password_user_path @current_user
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
# when /^(.*)'s profile page$/i
# user_profile_path(User.find_by_login($1))
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
# when /^(.*)'s profile page$/i
# user_profile_path(User.find_by_login($1))
else
begin