1 module NavigationHelpers
2 # Maps a name to a path. Used by the
4 # When /^I go to (.+)$/ do |page_name|
6 # step definition in web_steps.rb
11 when /the home\s?page/
13 when /devise_register/
16 # Add more mappings here.
17 # Here is an example that pulls values out of the Regexp:
19 # when /^(.*)'s profile page$/i
20 # user_profile_path(User.find_by_login($1))
24 page_name =~ /the (.*) page/
25 path_components = $1.split(/\s+/)
26 self.send(path_components.push('path').join('_').to_sym)
28 raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
29 "Now, go and add a mapping in #{__FILE__}"
35 World(NavigationHelpers)