[Rails5] Add `raise: false` to skip_before_action in authenticates_with_two_factor.rb
requested to merge blackst0ne-rails5-update-skip-before-action-in-authenticates-with-two-factor-concern into master
What does this MR do?
Rails 5.0 raises ArgumentErrror
if an unrecognised callback is skipped.
app/controllers/concerns/authenticates_with_two_factor.rb
skips require_no_authentication
which is not placed in the file (it's part of devise
).
In this case rails4
doesn't raise an error, but rails5
does.
This MR explicitly tells not to raise an error here.
Fixes:
% RAILS5=1 rspec spec/controllers/omniauth_callbacks_controller_spec.rb
# DEPRECATION MESSAGES SKIPPED
An error occurred while loading ./spec/controllers/omniauth_callbacks_controller_spec.rb.
Failure/Error: skip_before_action :require_no_authentication, only: [:create]
ArgumentError:
Before process_action callback :require_no_authentication has not been defined
# /usr/share/gems/ruby2.3/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:641:in `block (2 levels) in skip_callback'
# /usr/share/gems/ruby2.3/gems/activesupport-5.0.6/lib/active_support/callbacks.rb:637:in `each'
Are there points in the code the reviewer needs to double check?
No.
Why was this MR needed?
Migration to Rails 5.0
Screenshots (if relevant)
No.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)