aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-21 20:45:04 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-21 20:45:04 +0000
commit61c90a4ad6eab3623002353ed5867e2f05cb6809 (patch)
tree12855a156606c9af87c3f24d46d52dc859a55496 /actionpack/test/controller
parent32b36b8936b043d54daad072054f95429e462ff8 (diff)
downloadrails-61c90a4ad6eab3623002353ed5867e2f05cb6809.tar.gz
rails-61c90a4ad6eab3623002353ed5867e2f05cb6809.tar.bz2
rails-61c90a4ad6eab3623002353ed5867e2f05cb6809.zip
Reapply the TemplateFinder first applied in [8669] then reverted in [8676]. Closes #10800 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/mime_responds_test.rb6
-rw-r--r--actionpack/test/controller/new_render_test.rb10
-rw-r--r--actionpack/test/controller/render_test.rb9
-rw-r--r--actionpack/test/controller/view_paths_test.rb6
4 files changed, 12 insertions, 19 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb
index ce89b9dbbb..febdbd0993 100644
--- a/actionpack/test/controller/mime_responds_test.rb
+++ b/actionpack/test/controller/mime_responds_test.rb
@@ -437,11 +437,7 @@ class MimeControllerTest < Test::Unit::TestCase
end
class AbstractPostController < ActionController::Base
- class << self
- def view_paths
- [ File.dirname(__FILE__) + "/../fixtures/post_test/" ]
- end
- end
+ self.view_paths = File.dirname(__FILE__) + "/../fixtures/post_test/"
end
# For testing layouts which are set automatically
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index eb19b2e391..4a9b0e9ddf 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -78,11 +78,6 @@ class NewRenderTestController < ActionController::Base
@secret = 'in the sauce'
render :file => 'test/render_file_with_ivar', :use_full_path => true
end
-
- def render_file_not_using_full_path_with_relative_path
- @secret = 'in the sauce'
- render :file => 'test/../test/render_file_with_ivar', :use_full_path => true
- end
def render_file_not_using_full_path_with_dot_in_path
@secret = 'in the sauce'
@@ -488,11 +483,6 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal "The secret is in the sauce\n", @response.body
end
- def test_render_file_not_using_full_path_with_relative_path
- get :render_file_not_using_full_path_with_relative_path
- assert_equal "The secret is in the sauce\n", @response.body
- end
-
def test_render_file_not_using_full_path_with_dot_in_path
get :render_file_not_using_full_path_with_dot_in_path
assert_equal "The secret is in the sauce\n", @response.body
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index ddb77ee6b2..c258ae216b 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -20,6 +20,10 @@ class TestController < ActionController::Base
render :template => "test/hello_world"
end
+ def render_hello_world_with_forward_slash
+ render :template => "/test/hello_world"
+ end
+
def render_hello_world_from_variable
@person = "david"
render :text => "hello #{@person}"
@@ -221,6 +225,11 @@ class RenderTest < Test::Unit::TestCase
assert_template "test/hello_world"
end
+ def test_render_with_forward_slash
+ get :render_hello_world_with_forward_slash
+ assert_template "test/hello_world"
+ end
+
def test_render_from_variable
get :render_hello_world_from_variable
assert_equal "hello david", @response.body
diff --git a/actionpack/test/controller/view_paths_test.rb b/actionpack/test/controller/view_paths_test.rb
index b1ca400779..0516da32d8 100644
--- a/actionpack/test/controller/view_paths_test.rb
+++ b/actionpack/test/controller/view_paths_test.rb
@@ -16,7 +16,7 @@ class ViewLoadPathsTest < Test::Unit::TestCase
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"
+ prepend_view_path "#{LOAD_PATH_ROOT}/override"
end
end
@@ -27,7 +27,6 @@ class ViewLoadPathsTest < Test::Unit::TestCase
def setup
TestController.view_paths = nil
- ActionView::Base.cache_template_extensions = false
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@@ -45,7 +44,6 @@ class ViewLoadPathsTest < Test::Unit::TestCase
def teardown
ActiveSupport::Deprecation.behavior = @old_behavior
- ActionView::Base.cache_template_extensions = true
end
def test_template_load_path_was_set_correctly
@@ -99,7 +97,7 @@ class ViewLoadPathsTest < Test::Unit::TestCase
end
def test_view_paths_override
- TestController.view_paths.unshift "#{LOAD_PATH_ROOT}/override"
+ TestController.prepend_view_path "#{LOAD_PATH_ROOT}/override"
get :hello_world
assert_response :success
assert_equal "Hello overridden world!", @response.body