0
@@ -104,6 +104,12 @@ class TestController < ActionController::Base
0
+ def render_file_as_string_with_instance_variables
0
+ @secret = 'in the sauce'
0
+ path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb'))
0
def render_file_not_using_full_path
0
@secret = 'in the sauce'
0
render :file => 'test/render_file_with_ivar'
0
@@ -124,6 +130,11 @@ class TestController < ActionController::Base
0
render :file => path, :locals => {:secret => 'in the sauce'}
0
+ def render_file_as_string_with_locals
0
+ path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb'))
0
+ render path, :locals => {:secret => 'in the sauce'}
0
def accessing_request_in_template
0
render :inline => "Hello: <%= request.host %>"
0
@@ -182,10 +193,6 @@ class TestController < ActionController::Base
0
render :text => "appended"
0
- def render_invalid_args
0
def render_vanilla_js_hello
0
render :js => "alert('hello')"
0
@@ -751,6 +758,11 @@ class RenderTest < ActionController::TestCase
0
assert_equal "The secret is in the sauce\n", @response.body
0
+ def test_render_file_as_string_with_instance_variables
0
+ get :render_file_as_string_with_instance_variables
0
+ assert_equal "The secret is in the sauce\n", @response.body
0
def test_render_file_not_using_full_path
0
get :render_file_not_using_full_path
0
assert_equal "The secret is in the sauce\n", @response.body
0
@@ -766,6 +778,11 @@ class RenderTest < ActionController::TestCase
0
assert_equal "The secret is in the sauce\n", @response.body
0
+ def test_render_file_as_string_with_locals
0
+ get :render_file_as_string_with_locals
0
+ assert_equal "The secret is in the sauce\n", @response.body
0
def test_render_file_from_template
0
get :render_file_from_template
0
assert_equal "The secret is in the sauce\n", @response.body
0
@@ -831,10 +848,6 @@ class RenderTest < ActionController::TestCase
0
assert_equal 'appended', @response.body
0
- def test_attempt_to_render_with_invalid_arguments
0
- assert_raises(ActionController::RenderError) { get :render_invalid_args }
0
def test_attempt_to_access_object_method
0
assert_raises(ActionController::UnknownAction, "No action responded to [clone]") { get :clone }
A better exemple of using this news it’s for me :
render(Rails.root(’/public/404.html’))