aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authormisfo <tedwardo2@gmail.com>2009-03-14 10:42:02 -0500
committerJoshua Peek <josh@joshpeek.com>2009-03-14 10:42:02 -0500
commit7706b57034e91820cf83445aede57c54ab66ac2d (patch)
tree34f8e267eecabd996ab1acd66f709a00aa1ea8c7 /actionpack/test/controller
parent112056333f6ad2492a37b7eb9d647ecd23980592 (diff)
downloadrails-7706b57034e91820cf83445aede57c54ab66ac2d.tar.gz
rails-7706b57034e91820cf83445aede57c54ab66ac2d.tar.bz2
rails-7706b57034e91820cf83445aede57c54ab66ac2d.zip
allowed render :file to take Pathnames [#2220 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/render_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index af623395f0..a52931565d 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -157,6 +157,11 @@ class TestController < ActionController::Base
render :file => 'test/dot.directory/render_file_with_ivar'
end
+ def render_file_using_pathname
+ @secret = 'in the sauce'
+ render :file => Pathname.new(File.dirname(__FILE__)).join('..', 'fixtures', 'test', 'dot.directory', 'render_file_with_ivar.erb')
+ end
+
def render_file_from_template
@secret = 'in the sauce'
@path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb'))
@@ -861,6 +866,11 @@ class RenderTest < ActionController::TestCase
assert_equal "The secret is in the sauce\n", @response.body
end
+ def test_render_file_using_pathname
+ get :render_file_using_pathname
+ assert_equal "The secret is in the sauce\n", @response.body
+ end
+
def test_render_file_with_locals
get :render_file_with_locals
assert_equal "The secret is in the sauce\n", @response.body