diff options
author | Yehuda Katz <yehudakatz@YK.local> | 2010-02-23 22:45:42 -0800 |
---|---|---|
committer | Yehuda Katz <yehudakatz@YK.local> | 2010-02-23 22:45:42 -0800 |
commit | ae933a093db93c22b9facd3411afd9ef69719193 (patch) | |
tree | 1e5d944b79e6ff46050bc5af764b18d3b4282d8e /actionpack/test | |
parent | 47498a7f59d0196e9b8aa8e3569cbb4937477cef (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/fixtures/hello.html | 1 |
2 files changed, 10 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 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 |