aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-06-15 23:52:37 +0000
committerRick Olson <technoweenie@gmail.com>2007-06-15 23:52:37 +0000
commit7f517348db260fb0794a3644f761ac91fe540472 (patch)
treece43b8e4da29effdabb8d10578bdef72022a80ce /actionpack/test
parent9d4225f1298bebacc04cc0055b180c6b2926c024 (diff)
downloadrails-7f517348db260fb0794a3644f761ac91fe540472.tar.gz
rails-7f517348db260fb0794a3644f761ac91fe540472.tar.bz2
rails-7f517348db260fb0794a3644f761ac91fe540472.zip
Make ActionView#view_paths an attr_accessor for real this time. Also, don't perform an unnecessary #compact on the @view_paths array in #initialize. Closes #8582 [dasil003, julik, rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7034 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/view_paths_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index 6c07c40c0a..d6d6dac4f3 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -7,8 +7,15 @@ class ViewLoadPathsTest < Test::Unit::TestCase
class TestController < ActionController::Base
def self.controller_path() "test" end
def rescue_action(e) raise end
-
+
+ before_filter :add_view_path, :only => :hello_world_at_request_time
+
def hello_world() end
+ def hello_world_at_request_time() render(:action => 'hello_world') end
+ private
+ def add_view_path
+ self.class.view_paths.unshift "#{LOAD_PATH_ROOT}/override"
+ end
end
def setup
@@ -44,6 +51,12 @@ class ViewLoadPathsTest < Test::Unit::TestCase
assert_equal "Hello overridden world!", @response.body
end
+ def test_view_paths_override_at_request_time
+ get :hello_world_at_request_time
+ assert_response :success
+ assert_equal "Hello overridden world!", @response.body
+ end
+
def test_template_root_deprecated
assert_deprecated(/template_root.*view_paths/) do
TestController.template_root = 'foo/bar'