aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorYehuda Katz <yehudakatz@YK.local>2010-02-23 22:45:42 -0800
committerYehuda Katz <yehudakatz@YK.local>2010-02-23 22:45:42 -0800
commitae933a093db93c22b9facd3411afd9ef69719193 (patch)
tree1e5d944b79e6ff46050bc5af764b18d3b4282d8e /actionpack/test/controller
parent47498a7f59d0196e9b8aa8e3569cbb4937477cef (diff)
downloadrails-ae933a093db93c22b9facd3411afd9ef69719193.tar.gz
rails-ae933a093db93c22b9facd3411afd9ef69719193.tar.bz2
rails-ae933a093db93c22b9facd3411afd9ef69719193.zip
Fix render :file => "#{Rails.root}/public/404.html", :status => :not_found. Closes #8994
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/render_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 3cc22cc316..ecfe14b797 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -21,6 +21,10 @@ class TestController < ActionController::Base
def hello_world
end
+ def hello_world_file
+ render :file => File.expand_path("../../fixtures/hello.html", __FILE__)
+ end
+
def conditional_hello
if stale?(:last_modified => Time.now.utc.beginning_of_day, :etag => [:foo, 123])
render :action => 'hello_world'
@@ -751,6 +755,11 @@ class RenderTest < ActionController::TestCase
assert_equal "The secret is in the sauce\n", @response.body
end
+ def test_render_file
+ get :hello_world_file
+ assert_equal "Hello world!", @response.body
+ end
+
# :ported:
def test_render_file_as_string_with_instance_variables
get :render_file_as_string_with_instance_variables