diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-06-05 23:27:27 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-06-05 23:33:10 +0100 |
commit | 1dbfe9766e00282c56523f6969550494bbffbbf4 (patch) | |
tree | b2946d0a07cc2ee4c6916db4e41fc24698d19ba1 /actionpack/test | |
parent | 2e0765a00361781fb9bff2a7ca8996eab1f01bd4 (diff) | |
download | rails-1dbfe9766e00282c56523f6969550494bbffbbf4.tar.gz rails-1dbfe9766e00282c56523f6969550494bbffbbf4.tar.bz2 rails-1dbfe9766e00282c56523f6969550494bbffbbf4.zip |
Ensure render :file works inside templates
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/fixtures/test/render_file_from_template.html.erb | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 3b439a3b18..6b83b8337e 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -68,6 +68,11 @@ class NewRenderTestController < ActionController::Base path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb') render :file => path 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')) + end def render_file_with_locals path = File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb') @@ -531,6 +536,11 @@ class NewRenderTest < Test::Unit::TestCase get :render_file_with_locals assert_equal "The secret is in the sauce\n", @response.body end + + def test_render_file_from_template + get :render_file_from_template + assert_equal "The secret is in the sauce\n", @response.body + end def test_attempt_to_access_object_method assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone } diff --git a/actionpack/test/fixtures/test/render_file_from_template.html.erb b/actionpack/test/fixtures/test/render_file_from_template.html.erb new file mode 100644 index 0000000000..fde9f4bb64 --- /dev/null +++ b/actionpack/test/fixtures/test/render_file_from_template.html.erb @@ -0,0 +1 @@ +<%= render :file => @path %>
\ No newline at end of file |