aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
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
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')
-rw-r--r--actionpack/lib/action_view/template/resolver.rb2
-rw-r--r--actionpack/test/controller/render_test.rb9
-rw-r--r--actionpack/test/fixtures/hello.html1
3 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb
index 8acfe6cad0..20402f9d6d 100644
--- a/actionpack/lib/action_view/template/resolver.rb
+++ b/actionpack/lib/action_view/template/resolver.rb
@@ -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
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