A website template with lots of features, built with ruby on rails.

paths.rb 939B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module NavigationHelpers
  2. def path_to(page_name)
  3. case page_name
  4. when/the homepage/
  5. root_path
  6. when/the login page/
  7. visit new_user_session_path
  8. when/the signup page/
  9. visit new_user_registration_path
  10. when/the admin dashboard/
  11. visit admin_dashboard_path
  12. when/the configurations page/
  13. visit admin_config_path
  14. when/the blog page/
  15. visit blog_path
  16. when/the files page/
  17. visit admin_files_path
  18. when/the contact page/
  19. visit contact_messages_path
  20. when/the contact messages list/
  21. visit admin_contact_messages_path
  22. when/the admin blog posts page/
  23. visit admin_posts_path
  24. when/the subscribers page/
  25. visit admin_subscribers_path
  26. else
  27. raise "Can't find mapping from \"#{page_name}\" to a path."
  28. end
  29. end
  30. end
  31. World(NavigationHelpers)