Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't define _test_case method if already defined.

  • Loading branch information...
commit 8ee27afd064bccfc63b21f126109a9b20ce72bd5 1 parent 4bce8e3
@miloops miloops authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_view/test_case.rb
View
6 actionpack/lib/action_view/test_case.rb
@@ -137,8 +137,10 @@ def protect_against_forgery?
def make_test_case_available_to_view!
test_case_instance = self
_helpers.module_eval do
- define_method(:_test_case) { test_case_instance }
- private :_test_case
+ unless private_method_defined?(:_test_case)
+ define_method(:_test_case) { test_case_instance }
+ private :_test_case
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.