Skip to content

Instantly share code, notes, and snippets.

@Fivell
Created February 25, 2017 18:15
Show Gist options
  • Save Fivell/ea5efbfc8b60198676fbab2cfc1d3bf7 to your computer and use it in GitHub Desktop.
Save Fivell/ea5efbfc8b60198676fbab2cfc1d3bf7 to your computer and use it in GitHub Desktop.
Scenario: When the belongs to is optional and resources is renamed
Given a configuration of:
"""
ActiveAdmin.register User
ActiveAdmin.register Post, as: "Article" do
belongs_to :user, optional: true
navigation_menu :default
end
"""
When I go to the last author's articles
Then the "Users" tab should be selected
And I should see a menu item for "Articles"
When I follow "Articles"
Then the "Articles" tab should be selected
when /^the last author's articles/
admin_user_articles_path(User.last)
@Fivell
Copy link
Author

Fivell commented Feb 25, 2017


(::) failed steps (::)

undefined method `articles' for #<User:0x007fb90ee834f0> (NoMethodError)
./lib/active_admin/resource_controller/data_access.rb:74:in `scoped_collection'
./lib/active_admin/resource_controller/data_access.rb:56:in `find_collection'
./lib/active_admin/resource_controller/data_access.rb:42:in `collection'
./lib/active_admin/resource_controller/streaming.rb:12:in `index'
features/belongs_to.feature:122:in `When I go to the last author's articles'

Failing Scenarios:
cucumber features/belongs_to.feature:113 # Scenario: When the belongs to is optional and resources is renamed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment