From abfcdc65d96268b889a81b5fe55e4ce3b8cd5b7f Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Tue, 25 Sep 2012 17:39:29 -0400 Subject: Adds missing dependency to ActionView::TestCase::Behavior * The module is needed for the `determine_constant_from_test_name` method. * Without it, the including class is required to also include `ActiveSupport::Testing::ConstantLookup` or a `NoMethodError` will be raised upon instantiation of that class. * Issue introduced in c0a24555f9e2749fb94efe1967cb9943db0b6a7e --- actionpack/lib/action_view/test_case.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index a4e8068026..04073c73cc 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -47,6 +47,8 @@ module ActionView include ActionView::RecordIdentifier include ActionView::RoutingUrlFor + include ActiveSupport::Testing::ConstantLookup + delegate :lookup_context, :to => :controller attr_accessor :controller, :output_buffer, :rendered -- cgit v1.2.3 From 299e05706efe323b9adedefe1178283a4585a91b Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Tue, 25 Sep 2012 18:04:09 -0400 Subject: Also includes ConstantLookup dependency for controller and mailer tests --- actionmailer/lib/action_mailer/test_case.rb | 1 + actionpack/lib/action_controller/test_case.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index e60dda9694..80f323873d 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -20,6 +20,7 @@ module ActionMailer module Behavior extend ActiveSupport::Concern + include ActiveSupport::Testing::ConstantLookup include TestHelper included do diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index a28033fb32..0caeef3192 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -356,6 +356,7 @@ module ActionController module Behavior extend ActiveSupport::Concern include ActionDispatch::TestProcess + include ActiveSupport::Testing::ConstantLookup attr_reader :response, :request -- cgit v1.2.3 From ba3411067760ca6cd69c49a4e5c6c3a021011ce6 Mon Sep 17 00:00:00 2001 From: Andy Lindeman Date: Wed, 26 Sep 2012 23:21:09 -0400 Subject: ConstantLookup is not needed in every TestCase decendant --- activesupport/lib/active_support/test_case.rb | 1 - activesupport/test/testing/constant_lookup_test.rb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 1f874b56db..7b9378a7f6 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -38,7 +38,6 @@ module ActiveSupport include ActiveSupport::Testing::SetupAndTeardown include ActiveSupport::Testing::Assertions include ActiveSupport::Testing::Deprecation - include ActiveSupport::Testing::ConstantLookup def self.describe(text) if block_given? diff --git a/activesupport/test/testing/constant_lookup_test.rb b/activesupport/test/testing/constant_lookup_test.rb index d6552b5e49..c56c032cde 100644 --- a/activesupport/test/testing/constant_lookup_test.rb +++ b/activesupport/test/testing/constant_lookup_test.rb @@ -9,6 +9,7 @@ class Baz < Bar; end module FooBar; end class ConstantLookupTest < ActiveSupport::TestCase + include ActiveSupport::Testing::ConstantLookup def find_foo(name) self.class.determine_constant_from_test_name(name) do |constant| -- cgit v1.2.3