mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
31 lines
678 B
Ruby
31 lines
678 B
Ruby
module NavigationHelpers
|
|
def path_to(page_name)
|
|
case page_name
|
|
|
|
when /the homepage/
|
|
root_path
|
|
when /the home page/
|
|
root_path
|
|
when /the statistics page/
|
|
stats_path
|
|
when /the signup page/
|
|
signup_path
|
|
when /the login page/
|
|
login_path
|
|
when /the notes page/
|
|
notes_path
|
|
when /the contexts page/
|
|
contexts_path
|
|
when /the manage users page/
|
|
users_path
|
|
|
|
# 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
|
|
|
|
World(NavigationHelpers)
|