site_title.feature 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Feature: Site title
  2. As a developer
  3. In order to customize the site title
  4. I want to set it in the configuration
  5. Background:
  6. Given I am logged in
  7. Scenario: Set the site title and site title link
  8. Given a configuration of:
  9. """
  10. ActiveAdmin.application.site_title = "My Great Site"
  11. ActiveAdmin.application.site_title_link = "/"
  12. """
  13. When I am on the dashboard
  14. And I should see the site title "My Great Site"
  15. When I follow "My Great Site"
  16. Then I should see "Ruby on Rails: Welcome aboard"
  17. Scenario: Set the site title image
  18. Given a configuration of:
  19. """
  20. ActiveAdmin.application.site_title_image = "http://railscasts.com/assets/episodes/stills/284-active-admin.png?1316476106"
  21. """
  22. When I am on the dashboard
  23. And I should not see the site title "My Great Site"
  24. And I should see the site title image "http://railscasts.com/assets/episodes/stills/284-active-admin.png?1316476106"
  25. Scenario: Set the site title image with link
  26. Given a configuration of:
  27. """
  28. ActiveAdmin.application.site_title_link = "http://www.google.com"
  29. ActiveAdmin.application.site_title_image = "http://railscasts.com/assets/episodes/stills/284-active-admin.png?1316476106"
  30. """
  31. When I am on the dashboard
  32. And I should see the site title image "http://railscasts.com/assets/episodes/stills/284-active-admin.png?1316476106"
  33. And I should see the site title image linked to "http://www.google.com"
  34. Scenario: Set the site title to a proc
  35. Given a configuration of:
  36. """
  37. ActiveAdmin.application.site_title_image = nil # Configuration is not reset between scenarios
  38. ActiveAdmin.application.site_title = proc { "Hello #{controller.current_admin_user.email}" }
  39. """
  40. When I am on the dashboard
  41. And I should see the site title "Hello admin@example.com"