Permalink
Browse files

Don't define _test_case method if already defined.

  • Loading branch information...
1 parent 4bce8e3 commit 8ee27afd064bccfc63b21f126109a9b20ce72bd5 @miloops miloops committed Sep 28, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 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

0 comments on commit 8ee27af

Please sign in to comment.