pagination.feature 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Feature: Index Pagination
  2. Background:
  3. Scenario: Viewing index when one page of resources exist
  4. Given an index configuration of:
  5. """
  6. ActiveAdmin.register Post
  7. """
  8. Given 20 posts exist
  9. When I am on the index page for posts
  10. Then I should see "Displaying all 20 Posts"
  11. And I should not see pagination
  12. Scenario: Viewing index when multiple pages of resources exist
  13. Given an index configuration of:
  14. """
  15. ActiveAdmin.register Post
  16. """
  17. Given 31 posts exist
  18. When I am on the index page for posts
  19. Then I should see pagination with 2 pages
  20. Scenario: Viewing index with a custom per page set
  21. Given an index configuration of:
  22. """
  23. ActiveAdmin.register Post do
  24. config.per_page = 2
  25. end
  26. """
  27. Given 3 posts exist
  28. When I am on the index page for posts
  29. Then I should see pagination with 2 pages
  30. And I should see "Displaying Posts 1 - 2 of 3 in total"
  31. Scenario: Viewing index with pagination disabled
  32. Given an index configuration of:
  33. """
  34. ActiveAdmin.register Post do
  35. config.paginate = false
  36. end
  37. """
  38. Given 31 posts exist
  39. When I am on the index page for posts
  40. Then I should not see pagination