Repository navigation
Wrap helper_method calls in respond_to?(:helper_method) - #3732
Merged
lucasmazza merged 2 commits intoSep 26, 2015
Merged
Conversation
Member
There was a problem hiding this comment.
Please use the builtin methods: assert_includes, assert_respond_to and refute_respond_to. They provide nicer error messages in case of test failures.
Contributor
Author
There was a problem hiding this comment.
You're right, thank you.
Contributor
|
+1 |
|
This seems like a good solution, rather than adding mock support for this method in Rails 5 api code. |
Contributor
Author
|
Any updates on this PR? Thanks! |
Contributor
|
Sorry, for the delay, thanks for the fix ❤️ |
lucasmazza
added a commit
that referenced
this pull request
Sep 26, 2015
Wrap helper_method calls in respond_to?(:helper_method)
Contributor
Author
|
Thanks! On Sat, Sep 26, 2015, 10:05 AM Lucas Mazza [email protected] wrote:
|
This was referenced Dec 12, 2015
djsegal
added a commit
to djsegal/devise
that referenced
this pull request
Dec 18, 2015
lucasmazza
added a commit
that referenced
this pull request
Dec 18, 2015
Add #3732 helper logic to devise controller
Envek
added a commit
to Envek/monban
that referenced
this pull request
May 9, 2016
Currently `Monban::ControllerHelpers` depends on `#helper_method`, which is defined inside `AbstractController::Helpers`. This module is included in `ActionController::Base`, but it is not included by default in `ActionController::Metal`. So it's not available in Ruby on Rails 5.0 applications in API mode (rails-api). `#helper_method` is not essential to the functionality of the methods inside `Monban::ControllerHelpers`, so this PR wraps all `#helper_method` calls with `respond_to?(:helper_method)` checks. See rails/rails#21067 and heartcombo/devise#3732 for reference.
halogenandtoast
pushed a commit
to halogenandtoast/oath
that referenced
this pull request
May 24, 2016
Currently `Monban::ControllerHelpers` depends on `#helper_method`, which is defined inside `AbstractController::Helpers`. This module is included in `ActionController::Base`, but it is not included by default in `ActionController::Metal`. So it's not available in Ruby on Rails 5.0 applications in API mode (rails-api). `#helper_method` is not essential to the functionality of the methods inside `Monban::ControllerHelpers`, so this PR wraps all `#helper_method` calls with `respond_to?(:helper_method)` checks. See rails/rails#21067 and heartcombo/devise#3732 for reference.
jcoyne
added a commit
to projectblacklight/blacklight
that referenced
this pull request
Jun 4, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
jcoyne
added a commit
to projectblacklight/blacklight
that referenced
this pull request
Jun 4, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Nov 7, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Nov 8, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Nov 8, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Dec 15, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Dec 17, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Dec 17, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
cbeer
pushed a commit
to projectblacklight/blacklight
that referenced
this pull request
Dec 17, 2018
In API mode, the view layer is not available and these trigger method_missing errors. This fix is similar to how devise solved this problem: heartcombo/devise#3732
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently
Devise::Controllers::Helpersdepends on#helper_method, which is defined insideAbstractController::Helpers. This module is included inActionController::Base, but it is not included by default inActionController::Metal.#helper_methodis not essential to the functionality of the methods insideDevise::Controllers::Helpers, so this PR wraps all Devise#helper_methodcalls withrespond_to?(:helper_method)checks.