From 8a71f870093ccdfa0b04e318cca0f517576be380 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 16 Jan 2008 01:41:31 +0000 Subject: Ensure that the tests use the instance-level view-paths correctly. Closes #10820 [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8645 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/view_paths_test.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb index 889c5161d4..b1ca400779 100644 --- a/actionpack/test/controller/view_paths_test.rb +++ b/actionpack/test/controller/view_paths_test.rb @@ -28,10 +28,15 @@ class ViewLoadPathsTest < Test::Unit::TestCase def setup TestController.view_paths = nil ActionView::Base.cache_template_extensions = false - @controller = TestController.new + @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - + + @controller = TestController.new + # Following is needed in order to setup @controller.template object properly + @controller.send :initialize_template_class, @response + @controller.send :assign_shortcuts, @request, @response + # Track the last warning. @old_behavior = ActiveSupport::Deprecation.behavior @last_message = nil @@ -48,18 +53,18 @@ class ViewLoadPathsTest < Test::Unit::TestCase end def test_controller_appends_view_path_correctly - TestController.append_view_path 'foo' + @controller.append_view_path 'foo' assert_equal [LOAD_PATH_ROOT, 'foo'], @controller.view_paths - TestController.append_view_path(%w(bar baz)) + @controller.append_view_path(%w(bar baz)) assert_equal [LOAD_PATH_ROOT, 'foo', 'bar', 'baz'], @controller.view_paths end def test_controller_prepends_view_path_correctly - TestController.prepend_view_path 'baz' + @controller.prepend_view_path 'baz' assert_equal ['baz', LOAD_PATH_ROOT], @controller.view_paths - TestController.prepend_view_path(%w(foo bar)) + @controller.prepend_view_path(%w(foo bar)) assert_equal ['foo', 'bar', 'baz', LOAD_PATH_ROOT], @controller.view_paths end -- cgit v1.2.3