2009-04-13 22:26:20 +02:00
|
|
|
module NavigationHelpers
|
|
|
|
|
def path_to(page_name)
|
|
|
|
|
case page_name
|
|
|
|
|
|
|
|
|
|
when /the homepage/
|
|
|
|
|
root_path
|
2009-04-17 08:56:11 +02:00
|
|
|
when /the home page/
|
|
|
|
|
root_path
|
2009-04-13 22:26:20 +02:00
|
|
|
when /the statistics page/
|
|
|
|
|
stats_path
|
2009-04-17 08:56:11 +02:00
|
|
|
when /the signup page/
|
|
|
|
|
"/users/new"
|
|
|
|
|
when /the login page/
|
|
|
|
|
login_path
|
2009-05-25 20:30:20 +02:00
|
|
|
when /the notes page/
|
|
|
|
|
notes_path
|
2009-04-13 22:26:20 +02:00
|
|
|
|
|
|
|
|
# Add more page name => path mappings here
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
|
|
|
|
"Now, go and add a mapping in features/support/paths.rb"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2009-05-25 20:30:20 +02:00
|
|
|
World(NavigationHelpers)
|