aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-16 01:41:31 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-16 01:41:31 +0000
commit8a71f870093ccdfa0b04e318cca0f517576be380 (patch)
treee3db0f19e0c70695e147d04e3c0c3a407d1a285b /actionpack/test/controller
parent76ea495ec95410dcd98afdc72fefe25f212f68da (diff)
downloadrails-8a71f870093ccdfa0b04e318cca0f517576be380.tar.gz
rails-8a71f870093ccdfa0b04e318cca0f517576be380.tar.bz2
rails-8a71f870093ccdfa0b04e318cca0f517576be380.zip
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
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/view_paths_test.rb17
1 files changed, 11 insertions, 6 deletions
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