Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/render_test.rb, line 732
def setup
  # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
  # a more accurate simulation of what happens in "real life".
  super
  @controller.logger = Logger.new(nil)

  @request.host = "www.nextangle.com"
end
test_access_to_action_name_in_view()

:ported:

# File actionpack/test/controller/render_test.rb, line 953
def test_access_to_action_name_in_view
  get :accessing_action_name_in_template
  assert_equal "accessing_action_name_in_template", @response.body
end
test_access_to_controller_name_in_view()

:ported:

# File actionpack/test/controller/render_test.rb, line 959
def test_access_to_controller_name_in_view
  get :accessing_controller_name_in_template
  assert_equal "test", @response.body # name is explicitly set in the controller.
end
test_access_to_logger_in_view()
# File actionpack/test/controller/render_test.rb, line 947
def test_access_to_logger_in_view
  get :accessing_logger_in_template
  assert_equal "Logger", @response.body
end
test_access_to_request_in_view()

:ported:

# File actionpack/test/controller/render_test.rb, line 942
def test_access_to_request_in_view
  get :accessing_request_in_template
  assert_equal "Hello: www.nextangle.com", @response.body
end
test_accessing_local_assigns_in_inline_template()
# File actionpack/test/controller/render_test.rb, line 1033
def test_accessing_local_assigns_in_inline_template
  get :accessing_local_assigns_in_inline_template, :local_name => "Local David"
  assert_equal "Goodbye, Local David", @response.body
  assert_equal "text/html", @response.content_type
end
test_accessing_params_in_template()
# File actionpack/test/controller/render_test.rb, line 1028
def test_accessing_params_in_template
  get :accessing_params_in_template, :name => "David"
  assert_equal "Hello: David", @response.body
end
test_accessing_params_in_template_with_layout()
# File actionpack/test/controller/render_test.rb, line 1111
def test_accessing_params_in_template_with_layout
  get :accessing_params_in_template_with_layout, :name => "David"
  assert_equal "<html>Hello: David</html>", @response.body
end
test_action_talk_to_layout()
# File actionpack/test/controller/render_test.rb, line 1161
def test_action_talk_to_layout
  get :action_talk_to_layout
  assert_equal "<title>Talking to the layout</title>\nAction was here!", @response.body
end
test_attempt_to_access_object_method()

:ported:

# File actionpack/test/controller/render_test.rb, line 932
def test_attempt_to_access_object_method
  assert_raise(AbstractController::ActionNotFound, "No action responded to [clone]") { get :clone }
end
test_bad_render_to_string_still_throws_exception()
# File actionpack/test/controller/render_test.rb, line 1101
def test_bad_render_to_string_still_throws_exception
  assert_raise(ActionView::MissingTemplate) { get :render_to_string_with_exception }
end
test_do_with_render_action_and_layout_false()

:ported:

# File actionpack/test/controller/render_test.rb, line 838
def test_do_with_render_action_and_layout_false
  get :hello_world_with_layout_false
  assert_equal 'Hello world!', @response.body
end
test_do_with_render_text_and_layout()

:ported:

# File actionpack/test/controller/render_test.rb, line 832
def test_do_with_render_text_and_layout
  get :render_text_hello_world_with_layout
  assert_equal "<html>hello world, I am here!</html>", @response.body
end
test_double_redirect()
# File actionpack/test/controller/render_test.rb, line 1142
def test_double_redirect
  assert_raise(AbstractController::DoubleRenderError) { get :double_redirect }
end
test_double_render()

:ported:

# File actionpack/test/controller/render_test.rb, line 1138
def test_double_render
  assert_raise(AbstractController::DoubleRenderError) { get :double_render }
end
test_empty_partial_collection()
# File actionpack/test/controller/render_test.rb, line 1440
def test_empty_partial_collection
  get :empty_partial_collection
  assert_equal " ", @response.body
  assert_template :partial => false
end
test_hash_partial_collection()
# File actionpack/test/controller/render_test.rb, line 1461
def test_hash_partial_collection
  get :partial_hash_collection
  assert_equal "Pratik\nkitarP\nAmy\nymA\n", @response.body
end
test_head_created()
# File actionpack/test/controller/render_test.rb, line 1191
def test_head_created
  post :head_created
  assert_blank @response.body
  assert_response :created
end
test_head_created_with_application_json_content_type()
# File actionpack/test/controller/render_test.rb, line 1197
def test_head_created_with_application_json_content_type
  post :head_created_with_application_json_content_type
  assert_blank @response.body
  assert_equal "application/json", @response.content_type
  assert_response :created
end
test_head_with_custom_header()
# File actionpack/test/controller/render_test.rb, line 1225
def test_head_with_custom_header
  get :head_with_custom_header
  assert_blank @response.body
  assert_equal "something", @response.headers["X-Custom-Header"]
  assert_response :ok
end
test_head_with_integer_status()
# File actionpack/test/controller/render_test.rb, line 1260
def test_head_with_integer_status
  Rack::Utils::HTTP_STATUS_CODES.each do |code, message|
    get :head_with_integer_status, :status => code.to_s
    assert_equal message, @response.message
  end
end
test_head_with_location_header()
# File actionpack/test/controller/render_test.rb, line 1204
def test_head_with_location_header
  get :head_with_location_header
  assert_blank @response.body
  assert_equal "/foo", @response.headers["Location"]
  assert_response :ok
end
test_head_with_location_object()
# File actionpack/test/controller/render_test.rb, line 1211
def test_head_with_location_object
  with_routing do |set|
    set.draw do
      resources :customers
      match ':controller/:action'
    end

    get :head_with_location_object
    assert_blank @response.body
    assert_equal "http://www.nextangle.com/customers/1", @response.headers["Location"]
    assert_response :ok
  end
end
test_head_with_status_code_first()
# File actionpack/test/controller/render_test.rb, line 1274
def test_head_with_status_code_first
  get :head_with_status_code_first
  assert_equal 403, @response.response_code
  assert_equal "Forbidden", @response.message
  assert_equal "something", @response.headers["X-Custom-Header"]
  assert_response :forbidden
end
test_head_with_string_status()
# File actionpack/test/controller/render_test.rb, line 1267
def test_head_with_string_status
  get :head_with_string_status, :status => "404 Eat Dirt"
  assert_equal 404, @response.response_code
  assert_equal "Not Found", @response.message
  assert_response :not_found
end
test_head_with_symbolic_status()
# File actionpack/test/controller/render_test.rb, line 1239
def test_head_with_symbolic_status
  get :head_with_symbolic_status, :status => "ok"
  assert_equal 200, @response.status
  assert_response :ok

  get :head_with_symbolic_status, :status => "not_found"
  assert_equal 404, @response.status
  assert_response :not_found

  get :head_with_symbolic_status, :status => "no_content"
  assert_equal 204, @response.status
  assert !@response.headers.include?('Content-Length')
  assert_response :no_content

  Rack::Utils::SYMBOL_TO_STATUS_CODE.each do |status, code|
    get :head_with_symbolic_status, :status => status.to_s
    assert_equal code, @response.response_code
    assert_response status
  end
end
test_head_with_www_authenticate_header()
# File actionpack/test/controller/render_test.rb, line 1232
def test_head_with_www_authenticate_header
  get :head_with_www_authenticate_header
  assert_blank @response.body
  assert_equal "something", @response.headers["WWW-Authenticate"]
  assert_response :ok
end
test_layout_overriding_layout()
# File actionpack/test/controller/render_test.rb, line 1085
def test_layout_overriding_layout
  get :layout_overriding_layout
  assert_no_match %r{<title>}, @response.body
end
test_layout_rendering()

:ported:

# File actionpack/test/controller/render_test.rb, line 991
def test_layout_rendering
  get :layout_test
  assert_equal "<html>Hello world!</html>", @response.body
end
test_layout_test_with_different_layout()
# File actionpack/test/controller/render_test.rb, line 1065
def test_layout_test_with_different_layout
  get :layout_test_with_different_layout
  assert_equal "<html>Hello world!</html>", @response.body
end
test_layout_test_with_different_layout_and_string_action()
# File actionpack/test/controller/render_test.rb, line 1070
def test_layout_test_with_different_layout_and_string_action
  get :layout_test_with_different_layout_and_string_action
  assert_equal "<html>Hello world!</html>", @response.body
end
test_layout_test_with_different_layout_and_symbol_action()
# File actionpack/test/controller/render_test.rb, line 1075
def test_layout_test_with_different_layout_and_symbol_action
  get :layout_test_with_different_layout_and_symbol_action
  assert_equal "<html>Hello world!</html>", @response.body
end
test_line_offset()
# File actionpack/test/controller/render_test.rb, line 762
def test_line_offset
  begin
    get :render_line_offset
    flunk "the action should have raised an exception"
  rescue StandardError => exc
    line = exc.backtrace.first
    assert(line =~ %r{:(\d+):})
    assert_equal "1", $1,
      "The line offset is wrong, perhaps the wrong exception has been raised, exception was: #{exc.inspect}"
  end
end
test_locals_option_to_assert_template_is_not_supported()
# File actionpack/test/controller/render_test.rb, line 1408
def test_locals_option_to_assert_template_is_not_supported
  get :partial_collection_with_locals

  warning_buffer = StringIO.new
  $stderr = warning_buffer

  assert_template :partial => 'customer_greeting', :locals => { :greeting => 'Bonjour' }
  assert_equal "the :locals option to #assert_template is only supported in a ActionView::TestCase\n", warning_buffer.string
ensure
  $stderr = STDERR
end
test_namespaced_object_partial()
# File actionpack/test/controller/render_test.rb, line 1377
def test_namespaced_object_partial
  @controller = Quiz::QuestionsController.new
  get :new
  assert_equal "Namespaced Partial", @response.body
end
test_nested_partial_with_form_builder()
# File actionpack/test/controller/render_test.rb, line 1370
def test_nested_partial_with_form_builder
  @controller = Fun::GamesController.new
  get :nested_partial_with_form_builder
  assert_match(/<label/, @response.body)
  assert_template('fun/games/_form')
end
test_nested_rendering()

:ported:

# File actionpack/test/controller/render_test.rb, line 1022
def test_nested_rendering
  @controller = Fun::GamesController.new
  get :hello_world
  assert_equal "Living in a nested world", @response.body
end
test_overwritting_rendering_relative_file_with_extension()
# File actionpack/test/controller/render_test.rb, line 1183
def test_overwritting_rendering_relative_file_with_extension
  get :hello_world_from_rxml_using_template
  assert_equal "<html>\n  <p>Hello</p>\n</html>\n", @response.body

  get :hello_world_from_rxml_using_action
  assert_equal "<html>\n  <p>Hello</p>\n</html>\n", @response.body
end
test_partial_collection()
# File actionpack/test/controller/render_test.rb, line 1383
def test_partial_collection
  get :partial_collection
  assert_equal "Hello: davidHello: mary", @response.body
end
test_partial_collection_shorthand_with_different_types_of_records()
# File actionpack/test/controller/render_test.rb, line 1433
def test_partial_collection_shorthand_with_different_types_of_records
  get :partial_collection_shorthand_with_different_types_of_records
  assert_equal "Bonjour bad customer: mark0Bonjour good customer: craig1Bonjour bad customer: john2Bonjour good customer: zach3Bonjour good customer: brandon4Bonjour bad customer: dan5", @response.body
  assert_template :partial => 'good_customers/_good_customer', :count => 3
  assert_template :partial => 'bad_customers/_bad_customer', :count => 3
end
test_partial_collection_shorthand_with_locals()
# File actionpack/test/controller/render_test.rb, line 1426
def test_partial_collection_shorthand_with_locals
  get :partial_collection_shorthand_with_locals
  assert_equal "Bonjour: davidBonjour: mary", @response.body
  assert_template :partial => 'customers/_customer', :count => 2
  assert_template :partial => '_completely_fake_and_made_up_template_that_cannot_possibly_be_rendered', :count => 0
end
test_partial_collection_with_as()
# File actionpack/test/controller/render_test.rb, line 1388
def test_partial_collection_with_as
  get :partial_collection_with_as
  assert_equal "david david davidmary mary mary", @response.body
end
test_partial_collection_with_as_and_counter()
# File actionpack/test/controller/render_test.rb, line 1398
def test_partial_collection_with_as_and_counter
  get :partial_collection_with_as_and_counter
  assert_equal "david0mary1", @response.body
end
test_partial_collection_with_counter()
# File actionpack/test/controller/render_test.rb, line 1393
def test_partial_collection_with_counter
  get :partial_collection_with_counter
  assert_equal "david0mary1", @response.body
end
test_partial_collection_with_locals()
# File actionpack/test/controller/render_test.rb, line 1403
def test_partial_collection_with_locals
  get :partial_collection_with_locals
  assert_equal "Bonjour: davidBonjour: mary", @response.body
end
test_partial_collection_with_spacer()
# File actionpack/test/controller/render_test.rb, line 1420
def test_partial_collection_with_spacer
  get :partial_collection_with_spacer
  assert_equal "Hello: davidonly partialHello: mary", @response.body
  assert_template :partial => '_customer'
end
test_partial_hash_collection_with_locals()
# File actionpack/test/controller/render_test.rb, line 1466
def test_partial_hash_collection_with_locals
  get :partial_hash_collection_with_locals
  assert_equal "Hola: PratikHola: Amy", @response.body
end
test_partial_only()
# File actionpack/test/controller/render_test.rb, line 1292
def test_partial_only
  get :partial_only
  assert_equal "only partial", @response.body
  assert_equal "text/html", @response.content_type
end
test_partial_with_counter()
# File actionpack/test/controller/render_test.rb, line 1348
def test_partial_with_counter
  get :partial_with_counter
  assert_equal "5", @response.body
end
test_partial_with_form_builder()
# File actionpack/test/controller/render_test.rb, line 1358
def test_partial_with_form_builder
  get :partial_with_form_builder
  assert_match(/<label/, @response.body)
  assert_template('test/_form')
end
test_partial_with_form_builder_subclass()
# File actionpack/test/controller/render_test.rb, line 1364
def test_partial_with_form_builder_subclass
  get :partial_with_form_builder_subclass
  assert_match(/<label/, @response.body)
  assert_template('test/_labelling_form')
end
test_partial_with_hash_object()
# File actionpack/test/controller/render_test.rb, line 1446
def test_partial_with_hash_object
  get :partial_with_hash_object
  assert_equal "Sam\nmaS\n", @response.body
end
test_partial_with_locals()
# File actionpack/test/controller/render_test.rb, line 1353
def test_partial_with_locals
  get :partial_with_locals
  assert_equal "Hello: david", @response.body
end
test_partial_with_nested_object()
# File actionpack/test/controller/render_test.rb, line 1451
def test_partial_with_nested_object
  get :partial_with_nested_object
  assert_equal "first", @response.body
end
test_partial_with_nested_object_shorthand()
# File actionpack/test/controller/render_test.rb, line 1456
def test_partial_with_nested_object_shorthand
  get :partial_with_nested_object_shorthand
  assert_equal "first", @response.body
end
test_partials_list()
# File actionpack/test/controller/render_test.rb, line 1001
def test_partials_list
  get :partials_list
  assert_equal "goodbyeHello: davidHello: marygoodbye\n", @response.body
end
test_private_methods()

:ported:

# File actionpack/test/controller/render_test.rb, line 937
def test_private_methods
  assert_raise(AbstractController::ActionNotFound, "No action responded to [determine_layout]") { get :determine_layout }
end
test_render()

:ported:

# File actionpack/test/controller/render_test.rb, line 757
def test_render
  get :render_hello_world
  assert_template "test/hello_world"
end
test_render_action()

:ported:

# File actionpack/test/controller/render_test.rb, line 801
def test_render_action
  get :render_action_hello_world
  assert_template "test/hello_world"
end
test_render_action_hello_world_as_string()

:ported:

# File actionpack/test/controller/render_test.rb, line 813
def test_render_action_hello_world_as_string
  get :render_action_hello_world_as_string
  assert_equal "Hello world!", @response.body
  assert_template "test/hello_world"
end
test_render_action_upcased()
# File actionpack/test/controller/render_test.rb, line 806
def test_render_action_upcased
  assert_raise ActionView::MissingTemplate do
    get :render_action_upcased_hello_world
  end
end
test_render_action_with_symbol()

:ported:

# File actionpack/test/controller/render_test.rb, line 820
def test_render_action_with_symbol
  get :render_action_hello_world_with_symbol
  assert_template "test/hello_world"
end
test_render_and_redirect()
# File actionpack/test/controller/render_test.rb, line 1146
def test_render_and_redirect
  assert_raise(AbstractController::DoubleRenderError) { get :render_and_redirect }
end
test_render_call_to_partial_with_layout()
# File actionpack/test/controller/render_test.rb, line 1477
def test_render_call_to_partial_with_layout
  get :render_call_to_partial_with_layout
  assert_equal "Before (David)\nInside from partial (David)\nAfter", @response.body
end
test_render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout()
# File actionpack/test/controller/render_test.rb, line 1482
def test_render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout
  get :render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout
  assert_equal "Before (Anthony)\nInside from partial (Anthony)\nAfter\nBefore (David)\nInside from partial (David)\nAfter\nBefore (Ramm)\nInside from partial (Ramm)\nAfter", @response.body
end
test_render_custom_code()

:ported:

# File actionpack/test/controller/render_test.rb, line 899
def test_render_custom_code
  get :render_custom_code
  assert_response 404
  assert_response :missing
  assert_equal 'hello world', @response.body
end
test_render_file()
# File actionpack/test/controller/render_test.rb, line 849
def test_render_file
  assert_deprecated do
    get :hello_world_file
  end
  assert_equal "Hello world!", @response.body
end
test_render_file_as_string_with_instance_variables()

:ported:

# File actionpack/test/controller/render_test.rb, line 857
def test_render_file_as_string_with_instance_variables
  get :render_file_as_string_with_instance_variables
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_as_string_with_locals()

:ported:

# File actionpack/test/controller/render_test.rb, line 887
def test_render_file_as_string_with_locals
  get :render_file_as_string_with_locals
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_from_template()

:assessed:

# File actionpack/test/controller/render_test.rb, line 893
def test_render_file_from_template
  get :render_file_from_template
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_not_using_full_path()

:ported:

# File actionpack/test/controller/render_test.rb, line 863
def test_render_file_not_using_full_path
  get :render_file_not_using_full_path
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_not_using_full_path_with_dot_in_path()

:ported:

# File actionpack/test/controller/render_test.rb, line 869
def test_render_file_not_using_full_path_with_dot_in_path
  get :render_file_not_using_full_path_with_dot_in_path
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_using_pathname()

:ported:

# File actionpack/test/controller/render_test.rb, line 875
def test_render_file_using_pathname
  get :render_file_using_pathname
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_with_instance_variables()

:ported:

# File actionpack/test/controller/render_test.rb, line 844
def test_render_file_with_instance_variables
  get :render_file_with_instance_variables
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_file_with_locals()

:ported:

# File actionpack/test/controller/render_test.rb, line 881
def test_render_file_with_locals
  get :render_file_with_locals
  assert_equal "The secret is in the sauce\n", @response.body
end
test_render_from_variable()

:ported:

# File actionpack/test/controller/render_test.rb, line 795
def test_render_from_variable
  get :render_hello_world_from_variable
  assert_equal "hello david", @response.body
end
test_render_html_formatted_partial_even_with_other_mime_time_in_accept()
# File actionpack/test/controller/render_test.rb, line 1304
def test_render_html_formatted_partial_even_with_other_mime_time_in_accept
  @request.accept = "text/javascript, text/html"

  get :partial_html_erb

  assert_equal "partial.html.erb", @response.body.strip
  assert_equal "text/html", @response.content_type
end
test_render_in_top_directory()

:ported:

# File actionpack/test/controller/render_test.rb, line 781
def test_render_in_top_directory
  get :render_template_in_top_directory
  assert_template "shared"
  assert_equal "Elastica", @response.body
end
test_render_in_top_directory_with_slash()

:ported:

# File actionpack/test/controller/render_test.rb, line 788
def test_render_in_top_directory_with_slash
  get :render_template_in_top_directory_with_slash
  assert_template "shared"
  assert_equal "Elastica", @response.body
end
test_render_missing_partial_template()
# File actionpack/test/controller/render_test.rb, line 1471
def test_render_missing_partial_template
  assert_raise(ActionView::MissingTemplate) do
    get :missing_partial
  end
end
test_render_nothing_with_appendix()

:ported:

# File actionpack/test/controller/render_test.rb, line 920
def test_render_nothing_with_appendix
  get :render_nothing_with_appendix
  assert_response 200
  assert_equal 'appended', @response.body
end
test_render_template_within_a_template_with_other_format()
# File actionpack/test/controller/render_test.rb, line 1341
def test_render_template_within_a_template_with_other_format
  get :render_template_within_a_template_with_other_format
  expected = "only html partial<p>This is grand!</p>"
  assert_equal expected, @response.body.strip
  assert_equal "text/html", @response.content_type
end
test_render_text()

:ported:

# File actionpack/test/controller/render_test.rb, line 826
def test_render_text
  get :render_text_hello_world
  assert_equal "hello world", @response.body
end
test_render_text_with_assigns()

:addressed:

# File actionpack/test/controller/render_test.rb, line 1167
def test_render_text_with_assigns
  get :render_text_with_assigns
  assert_equal "world", assigns["hello"]
end
test_render_text_with_false()

:ported:

# File actionpack/test/controller/render_test.rb, line 914
def test_render_text_with_false
  get :render_text_with_false
  assert_equal 'false', @response.body
end
test_render_text_with_nil()

:ported:

# File actionpack/test/controller/render_test.rb, line 907
def test_render_text_with_nil
  get :render_text_with_nil
  assert_response 200
  assert_equal ' ', @response.body
end
test_render_text_with_resource()
# File actionpack/test/controller/render_test.rb, line 926
def test_render_text_with_resource
  get :render_text_with_resource
  assert_equal 'name: "David"', @response.body
end
test_render_to_string()
# File actionpack/test/controller/render_test.rb, line 1006
def test_render_to_string
  get :hello_in_a_string
  assert_equal "How's there? goodbyeHello: davidHello: marygoodbye\n", @response.body
end
test_render_to_string_and_render()

specify the one exception to double render rule - render_to_string followed by render

# File actionpack/test/controller/render_test.rb, line 1151
def test_render_to_string_and_render
  get :render_to_string_and_render
  assert_equal("Hi web users! here is some cached stuff", @response.body)
end
test_render_to_string_and_render_with_different_formats()
# File actionpack/test/controller/render_test.rb, line 1334
def test_render_to_string_and_render_with_different_formats
  get :render_to_string_and_render_with_different_formats
  assert_equal "<strong>only partial</strong>\n", assigns(:html)
  assert_equal "**only partial**\n", @response.body
  assert_equal "text/plain", @response.content_type
end
test_render_to_string_doesnt_break_assigns()
# File actionpack/test/controller/render_test.rb, line 1095
def test_render_to_string_doesnt_break_assigns
  get :render_to_string_with_assigns
  assert_equal "i'm before the render", assigns(:before)
  assert_equal "i'm after the render", assigns(:after)
end
test_render_to_string_inline()
# File actionpack/test/controller/render_test.rb, line 1016
def test_render_to_string_inline
  get :render_to_string_with_inline_and_render
  assert_template "test/hello_world"
end
test_render_to_string_partial()
# File actionpack/test/controller/render_test.rb, line 1319
def test_render_to_string_partial
  get :render_to_string_with_partial
  assert_equal "only partial", assigns(:partial_only)
  assert_equal "Hello: david", assigns(:partial_with_locals)
  assert_equal "text/html", @response.content_type
end
test_render_to_string_resets_assigns()
# File actionpack/test/controller/render_test.rb, line 1011
def test_render_to_string_resets_assigns
  get :render_to_string_test
  assert_equal "The value of foo is: ::this is a test::\n", @response.body
end
test_render_to_string_that_throws_caught_exception_doesnt_break_assigns()
# File actionpack/test/controller/render_test.rb, line 1105
def test_render_to_string_that_throws_caught_exception_doesnt_break_assigns
  assert_nothing_raised { get :render_to_string_with_caught_exception }
  assert_equal "i'm before the render", assigns(:before)
  assert_equal "i'm after the render", assigns(:after)
end
test_render_to_string_with_template_and_html_partial()
# File actionpack/test/controller/render_test.rb, line 1326
def test_render_to_string_with_template_and_html_partial
  get :render_to_string_with_template_and_html_partial
  assert_equal "**only partial**\n", assigns(:text)
  assert_equal "<strong>only partial</strong>\n", assigns(:html)
  assert_equal "<strong>only html partial</strong>\n", @response.body
  assert_equal "text/html", @response.content_type
end
test_render_with_explicit_string_template()
# File actionpack/test/controller/render_test.rb, line 1127
def test_render_with_explicit_string_template
  get :render_with_explicit_string_template
  assert_equal "<html>Hello world!</html>", @response.body
end
test_render_with_explicit_template()
# File actionpack/test/controller/render_test.rb, line 1116
def test_render_with_explicit_template
  get :render_with_explicit_template
  assert_response :success
end
test_render_with_explicit_unescaped_template()
# File actionpack/test/controller/render_test.rb, line 1121
def test_render_with_explicit_unescaped_template
  assert_raise(ActionView::MissingTemplate) { get :render_with_explicit_unescaped_template }
  get :render_with_explicit_escaped_template
  assert_equal "Hello w*rld!", @response.body
end
test_render_with_filters()
# File actionpack/test/controller/render_test.rb, line 1132
def test_render_with_filters
  get :render_with_filters
  assert_equal "<test>passed formatted xml erb</test>", @response.body
end
test_render_with_forward_slash()

:ported: compatibility

# File actionpack/test/controller/render_test.rb, line 775
def test_render_with_forward_slash
  get :render_hello_world_with_forward_slash
  assert_template "test/hello_world"
end
test_render_xml()

:ported:

# File actionpack/test/controller/render_test.rb, line 965
def test_render_xml
  get :render_xml_hello
  assert_equal "<html>\n  <p>Hello David</p>\n<p>This is grand!</p>\n</html>\n", @response.body
  assert_equal "application/xml", @response.content_type
end
test_render_xml_as_string_template()

:ported:

# File actionpack/test/controller/render_test.rb, line 972
def test_render_xml_as_string_template
  get :render_xml_hello_as_string_template
  assert_equal "<html>\n  <p>Hello David</p>\n<p>This is grand!</p>\n</html>\n", @response.body
  assert_equal "application/xml", @response.content_type
end
test_render_xml_with_default()

:ported:

# File actionpack/test/controller/render_test.rb, line 979
def test_render_xml_with_default
  get :greeting
  assert_equal "<p>This is grand!</p>\n", @response.body
end
test_render_xml_with_layouts()
# File actionpack/test/controller/render_test.rb, line 996
def test_render_xml_with_layouts
  get :builder_layout_test
  assert_equal "<wrapper>\n<html>\n  <p>Hello </p>\n<p>This is grand!</p>\n</html>\n</wrapper>\n", @response.body
end
test_render_xml_with_partial()

:move: test in AV

# File actionpack/test/controller/render_test.rb, line 985
def test_render_xml_with_partial
  get :builder_partial_test
  assert_equal "<test>\n  <hello/>\n</test>\n", @response.body
end
test_rendering_nothing_on_layout()
# File actionpack/test/controller/render_test.rb, line 1090
def test_rendering_nothing_on_layout
  get :rendering_nothing_on_layout
  assert_equal " ", @response.body
end
test_rendering_with_conflicting_local_vars()
# File actionpack/test/controller/render_test.rb, line 1156
def test_rendering_with_conflicting_local_vars
  get :rendering_with_conflicting_local_vars
  assert_equal("First: David\nSecond: Stephan\nThird: David\nFourth: David\nFifth: ", @response.body)
end
test_rendering_without_layout()
# File actionpack/test/controller/render_test.rb, line 1080
def test_rendering_without_layout
  get :rendering_without_layout
  assert_equal "Hello world!", @response.body
end
test_renders_default_template_for_missing_action()

:ported:

# File actionpack/test/controller/render_test.rb, line 751
def test_renders_default_template_for_missing_action
  get :'hyphen-ated'
  assert_template 'test/hyphen-ated'
end
test_should_implicitly_render_html_template_from_xhr_request()
# File actionpack/test/controller/render_test.rb, line 1039
def test_should_implicitly_render_html_template_from_xhr_request
  xhr :get, :render_implicit_html_template_from_xhr_request
  assert_equal "XHR!\nHello HTML!", @response.body
end
test_should_implicitly_render_js_template_without_layout()
# File actionpack/test/controller/render_test.rb, line 1044
def test_should_implicitly_render_js_template_without_layout
  get :render_implicit_js_template_without_layout, :format => :js
  assert_no_match %r{<html>}, @response.body
end
test_should_render_formatted_html_erb_template()
# File actionpack/test/controller/render_test.rb, line 1054
def test_should_render_formatted_html_erb_template
  get :formatted_xml_erb
  assert_equal '<test>passed formatted html erb</test>', @response.body
end
test_should_render_formatted_html_erb_template_with_faulty_accepts_header()
# File actionpack/test/controller/render_test.rb, line 1059
def test_should_render_formatted_html_erb_template_with_faulty_accepts_header
  @request.accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, appliction/x-shockwave-flash, */*"
  get :formatted_xml_erb
  assert_equal '<test>passed formatted html erb</test>', @response.body
end
test_should_render_formatted_template()
# File actionpack/test/controller/render_test.rb, line 1049
def test_should_render_formatted_template
  get :formatted_html_erb
  assert_equal 'formatted html erb', @response.body
end
test_should_render_html_formatted_partial()
# File actionpack/test/controller/render_test.rb, line 1298
def test_should_render_html_formatted_partial
  get :partial
  assert_equal "partial html", @response.body
  assert_equal "text/html", @response.content_type
end
test_should_render_html_partial_with_formats()
# File actionpack/test/controller/render_test.rb, line 1313
def test_should_render_html_partial_with_formats
  get :partial_formats_html
  assert_equal "partial html", @response.body
  assert_equal "text/html", @response.content_type
end
test_simple_show()

:ported:

# File actionpack/test/controller/render_test.rb, line 742
def test_simple_show
  get :hello_world
  assert_response 200
  assert_response :success
  assert_template "test/hello_world"
  assert_equal "<html>Hello world!</html>", @response.body
end
test_template_with_locals()

:ported:

# File actionpack/test/controller/render_test.rb, line 1173
def test_template_with_locals
  get :render_with_explicit_template_with_locals
  assert_equal "The secret is area51\n", @response.body
end
test_using_layout_around_block()
# File actionpack/test/controller/render_test.rb, line 1282
def test_using_layout_around_block
  get :render_using_layout_around_block
  assert_equal "Before (David)\nInside from block\nAfter", @response.body
end
test_using_layout_around_block_in_main_layout_and_within_content_for_layout()
# File actionpack/test/controller/render_test.rb, line 1287
def test_using_layout_around_block_in_main_layout_and_within_content_for_layout
  get :render_using_layout_around_block_in_main_layout_and_within_content_for_layout
  assert_equal "Before (Anthony)\nInside from first block in layout\nAfter\nBefore (David)\nInside from block\nAfter\nBefore (Ramm)\nInside from second block in layout\nAfter\n", @response.body
end
test_yield_content_for()
# File actionpack/test/controller/render_test.rb, line 1178
def test_yield_content_for
  get :yield_content_for
  assert_equal "<title>Putting stuff in the title!</title>\nGreat stuff!\n", @response.body
end