1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/abstract
Jess Bees 60f7d49033 Raise error when callback's only/unless symbols aren't methods
When `before_action :callback, only: :action_name` is declared on a
controller that doesn't respond to `action_name`, raise an exception
at request time. This is a safety measure to ensure that typos or
forgetfulness don't prevent a crucial callback from being run when it
should.

Include names of filters for more useful error messages

The error message of the raised exception will be more useful if it
indicates the names of the callbacks that have the missing conditinoal
action.

The way the callbacks get shoehorned into `_normalize_callback_options`
options parameter is a little awkward, but done this way to avoid
changing the method's signature, since it is a publicly documented
method.
2021-12-14 15:22:08 -05:00
..
callbacks_test.rb Raise error when callback's only/unless symbols aren't methods 2021-12-14 15:22:08 -05:00
collector_test.rb Fix generated MIME methods to recognize kwargs 2021-08-07 13:59:08 +09:00
translation_test.rb Treat html suffix in controller translation 2021-10-08 21:21:53 +00:00