registering_pages.feature 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Feature: Registering Pages
  2. Registering pages within Active Admin
  3. Background:
  4. Given I am logged in
  5. Scenario: Registering a page
  6. Given a configuration of:
  7. """
  8. ActiveAdmin.register_page "Status" do
  9. content do
  10. "I love chocolate."
  11. end
  12. end
  13. """
  14. When I go to the dashboard
  15. And I follow "Status"
  16. Then I should see the page title "Status"
  17. And I should see the Active Admin layout
  18. And I should see the content "I love chocolate."
  19. Scenario: Registering an empty page
  20. Given a configuration of:
  21. """
  22. ActiveAdmin.register_page "Status"
  23. """
  24. When I go to the dashboard
  25. And I follow "Status"
  26. Then I should see the page title "Status"
  27. And I should see the Active Admin layout
  28. Scenario: Adding a sidebar section to a page
  29. Given a configuration of:
  30. """
  31. ActiveAdmin.register_page "Status" do
  32. sidebar :help do
  33. "Need help? Email us at help@example.com"
  34. end
  35. content do
  36. "I love chocolate."
  37. end
  38. end
  39. """
  40. When I go to the dashboard
  41. And I follow "Status"
  42. Then I should see a sidebar titled "Help"
  43. Scenario: Adding an action item to a page
  44. Given a configuration of:
  45. """
  46. ActiveAdmin.register_page "Status" do
  47. action_item do
  48. link_to "Visit", "/"
  49. end
  50. content do
  51. "I love chocolate."
  52. end
  53. end
  54. """
  55. When I go to the dashboard
  56. And I follow "Status"
  57. Then I should see an action item link to "Visit"