From ae933a093db93c22b9facd3411afd9ef69719193 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Tue, 23 Feb 2010 22:45:42 -0800 Subject: Fix render :file => "#{Rails.root}/public/404.html", :status => :not_found. Closes #8994 --- actionpack/test/controller/render_test.rb | 9 +++++++++ actionpack/test/fixtures/hello.html | 1 + 2 files changed, 10 insertions(+) create mode 100644 actionpack/test/fixtures/hello.html (limited to 'actionpack/test') 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 diff --git a/actionpack/test/fixtures/hello.html b/actionpack/test/fixtures/hello.html new file mode 100644 index 0000000000..6769dd60bd --- /dev/null +++ b/actionpack/test/fixtures/hello.html @@ -0,0 +1 @@ +Hello world! \ No newline at end of file -- cgit v1.2.3