Permalink
Browse files

Fix render :file => "#{Rails.root}/public/404.html", :status => :not_…

…found. Closes #8994
  • Loading branch information...
1 parent 47498a7 commit ae933a093db93c22b9facd3411afd9ef69719193 Yehuda Katz committed Feb 24, 2010
@@ -20,7 +20,7 @@ def self.register_detail(name, options = {})
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 LabellingFormBuilder < ActionView::Helpers::FormBuilder
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 @@ def test_render_file_with_instance_variables
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
@@ -0,0 +1 @@
+Hello world!

0 comments on commit ae933a0

Please sign in to comment.