dashboard.feature 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Feature: Dashboard
  2. Background:
  3. Given I am logged in
  4. Scenario: With no configuration
  5. Given a configuration of:
  6. """
  7. """
  8. When I go to the dashboard
  9. Then I should see the default welcome message
  10. Scenario: Displaying a dashboard widget
  11. Given a configuration of:
  12. """
  13. ActiveAdmin::Dashboards.build do
  14. section 'Hello World' do
  15. para "Hello world from the content"
  16. end
  17. end
  18. """
  19. When I go to the dashboard
  20. Then I should not see the default welcome message
  21. And I should see a dashboard widget "Hello World"
  22. And I should see "Hello world from the content"
  23. Scenario: Displaying a dashboard widget using the ':if' option
  24. Given a configuration of:
  25. """
  26. ActiveAdmin::Dashboards.build do
  27. section 'Hello World', :if => proc{ current_admin_user } do
  28. "Hello world from the content"
  29. end
  30. section 'Hidden by If', :if => proc{ false } do
  31. "Hello world from the content"
  32. end
  33. end
  34. """
  35. When I go to the dashboard
  36. Then I should not see the default welcome message
  37. And I should see a dashboard widget "Hello World"
  38. And I should not see a dashboard widget "Hidden by If"