belongs_to.feature 836 B

123456789101112131415161718192021222324252627
  1. Feature: Belongs To
  2. A resource belongs to another resource
  3. Background:
  4. Given a configuration of:
  5. """
  6. ActiveAdmin.register User
  7. ActiveAdmin.register Post do
  8. belongs_to :user
  9. end
  10. """
  11. And I am logged in
  12. And a post with the title "Hello World" written by "John Doe" exists
  13. And a post with the title "Hello World" written by "Jane Doe" exists
  14. Scenario: Viewing the child resource index page
  15. When I go to the last author's posts
  16. Then the "Users" tab should be selected
  17. And I should see "Displaying 1 Post"
  18. And I should see a link to "Users" in the breadcrumb
  19. Scenario: Viewing a child resource page
  20. When I go to the last author's posts
  21. And I follow "View"
  22. Then I should be on the last author's last post page
  23. And the "Users" tab should be selected