aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb9
-rw-r--r--actionpack/test/fixtures/hello.html1
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