aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-05-27 12:24:46 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-27 12:24:46 +0100
commitf8b402c5d81c7baedae9a27eebf83aa947698cc0 (patch)
treef3012914003ee63ce34abf498b5015a875273b63 /actionpack/lib
parent9d9c96af56986b84a732aa609569b5035825f5f8 (diff)
parent888a2927b65889465ce7a1a71e87d37640a2b41b (diff)
downloadrails-f8b402c5d81c7baedae9a27eebf83aa947698cc0.tar.gz
rails-f8b402c5d81c7baedae9a27eebf83aa947698cc0.tar.bz2
rails-f8b402c5d81c7baedae9a27eebf83aa947698cc0.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/test_case.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index b2e6589d81..16fedd9732 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -1,14 +1,6 @@
require 'active_support/test_case'
module ActionView
- class NonInferrableHelperError < ActionViewError
- def initialize(name)
- super "Unable to determine the helper to test from #{name}. " +
- "You'll need to specify it using tests YourHelper in your " +
- "test case definition"
- end
- end
-
class TestCase < ActiveSupport::TestCase
class_inheritable_accessor :helper_class
@@helper_class = nil
@@ -29,7 +21,7 @@ module ActionView
def determine_default_helper_class(name)
name.sub(/Test$/, '').constantize
rescue NameError
- raise NonInferrableHelperError.new(name)
+ nil
end
end
@@ -42,7 +34,9 @@ module ActionView
setup :setup_with_helper_class
def setup_with_helper_class
- self.class.send(:include, helper_class)
+ if helper_class && !self.class.ancestors.include?(helper_class)
+ self.class.send(:include, helper_class)
+ end
end
class TestController < ActionController::Base