mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix render :file => "#{Rails.root}/public/404.html", :status => :not_found. Closes #8994
This commit is contained in:
parent
47498a7f59
commit
ae933a093d
3 changed files with 11 additions and 1 deletions
|
@ -20,7 +20,7 @@ module ActionView
|
|||
|
||||
register_detail(:locale) { [I18n.locale] }
|
||||
register_detail(:formats) { Mime::SET.symbols }
|
||||
register_detail(:handlers, :allow_nil => false) do
|
||||
register_detail(:handlers) do
|
||||
Template::Handlers.extensions
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
1
actionpack/test/fixtures/hello.html
vendored
Normal file
1
actionpack/test/fixtures/hello.html
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
Hello world!
|
Loading…
Reference in a new issue