You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rails 7.2 introduced a new config option to make it so that an error is raised if the only or except list in a before_action mentions a method that doesn't exist on the controller. Currently the test suite in the starter repo gets a lot of failures if that is enabled.
This test will fail if that config option is set to true:
rails test test/controllers/account/scaffolding/completely_concrete/tangible_things_controller_test.rb:28
The individual failures look like this and don't include much information:
Account::Scaffolding::CompletelyConcrete::TangibleThingsControllerTest
test_should_get_index FAIL (0.70s)
Expected response to be a <2XX: success>, but was a <404: Not Found>
test/controllers/account/scaffolding/completely_concrete/tangible_things_controller_test.rb:30:in `block in <class:TangibleThingsControllerTest>'
Failures and errors:
Account::Scaffolding::CompletelyConcrete::TangibleThingsControllerTest
test_should_get_index FAIL (0.70s)
Expected response to be a <2XX: success>, but was a <404: Not Found>
test/controllers/account/scaffolding/completely_concrete/tangible_things_controller_test.rb:30:in `block in <class:TangibleThingsControllerTest>'
If you tail the test log you'll see an error at the bottom of the test run that says this:
AbstractController::ActionNotFound (The reorder action could not be found for the #<Proc:0x0000000158051b40 /Users/jgreen/.asdf/installs/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/cancancan-3.6.1/lib/cancan/controller_resource.rb:15>
callback on Account::Scaffolding::CompletelyConcrete::TangibleThingsController, but it is listed in the controller's
:only option.
Raising for missing callback actions is a new default in Rails 7.1, if you'd
like to turn this off you can delete the option from the environment configurations
or set `config.action_controller.raise_on_missing_callback_actions` to `false`.
):
That message points to a file in the cancancan gem:
We're always including the reorder action in the list of collection_actions even if the model is not sortable. I think we need to either define an empty reorder method somewhere that it's available to all super scaffolded controllers, or we need to make it so that reorder is only included in the list if the model is actually sortable.
The text was updated successfully, but these errors were encountered:
Rails 7.2 introduced a new config option to make it so that an error is raised if the
only
orexcept
list in abefore_action
mentions a method that doesn't exist on the controller. Currently the test suite in the starter repo gets a lot of failures if that is enabled.This test will fail if that config option is set to true:
The individual failures look like this and don't include much information:
If you tail the test log you'll see an error at the bottom of the test run that says this:
That message points to a file in the
cancancan
gem:https://github.com/CanCanCommunity/cancancan/blob/c63cde14d419474a9da2ddb03956440045348577/lib/cancan/controller_resource.rb#L15
But that line in
cancancan
is just applying options defined in the controller, so I don't think thatcancancan
is at fault here.I think this line is what's causing the problem:
bullet_train-core/bullet_train-super_load_and_authorize_resource/app/controllers/concerns/bullet_train/loads_and_authorizes_resource.rb
Line 88 in 00fdeb2
We're always including the
reorder
action in the list ofcollection_actions
even if the model is not sortable. I think we need to either define an emptyreorder
method somewhere that it's available to all super scaffolded controllers, or we need to make it so thatreorder
is only included in the list if the model is actually sortable.The text was updated successfully, but these errors were encountered: