Methods
- S
- T
-
- test_access_to_action_name_in_view,
- test_access_to_controller_name_in_view,
- test_access_to_logger_in_view,
- test_access_to_request_in_view,
- test_accessing_local_assigns_in_inline_template,
- test_accessing_params_in_template,
- test_accessing_params_in_template_with_layout,
- test_action_talk_to_layout,
- test_attempt_to_access_object_method,
- test_bad_render_to_string_still_throws_exception,
- test_do_with_render_action_and_layout_false,
- test_do_with_render_text_and_layout,
- test_double_redirect,
- test_double_render,
- test_empty_partial_collection,
- test_hash_partial_collection,
- test_head_created,
- test_head_created_with_application_json_content_type,
- test_head_with_custom_header,
- test_head_with_integer_status,
- test_head_with_location_header,
- test_head_with_location_object,
- test_head_with_status_code_first,
- test_head_with_string_status,
- test_head_with_symbolic_status,
- test_head_with_www_authenticate_header,
- test_layout_overriding_layout,
- test_layout_rendering,
- test_layout_test_with_different_layout,
- test_layout_test_with_different_layout_and_string_action,
- test_layout_test_with_different_layout_and_symbol_action,
- test_line_offset,
- test_locals_option_to_assert_template_is_not_supported,
- test_namespaced_object_partial,
- test_nested_partial_with_form_builder,
- test_nested_rendering,
- test_overwritting_rendering_relative_file_with_extension,
- test_partial_collection,
- test_partial_collection_shorthand_with_different_types_of_records,
- test_partial_collection_shorthand_with_locals,
- test_partial_collection_with_as,
- test_partial_collection_with_as_and_counter,
- test_partial_collection_with_counter,
- test_partial_collection_with_locals,
- test_partial_collection_with_spacer,
- test_partial_hash_collection_with_locals,
- test_partial_only,
- test_partial_with_counter,
- test_partial_with_form_builder,
- test_partial_with_form_builder_subclass,
- test_partial_with_hash_object,
- test_partial_with_locals,
- test_partial_with_nested_object,
- test_partial_with_nested_object_shorthand,
- test_partials_list,
- test_private_methods,
- test_render,
- test_render_action,
- test_render_action_hello_world_as_string,
- test_render_action_upcased,
- test_render_action_with_symbol,
- test_render_and_redirect,
- test_render_call_to_partial_with_layout,
- test_render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout,
- test_render_custom_code,
- test_render_file,
- test_render_file_as_string_with_instance_variables,
- test_render_file_as_string_with_locals,
- test_render_file_from_template,
- test_render_file_not_using_full_path,
- test_render_file_not_using_full_path_with_dot_in_path,
- test_render_file_using_pathname,
- test_render_file_with_instance_variables,
- test_render_file_with_locals,
- test_render_from_variable,
- test_render_html_formatted_partial_even_with_other_mime_time_in_accept,
- test_render_in_top_directory,
- test_render_in_top_directory_with_slash,
- test_render_missing_partial_template,
- test_render_nothing_with_appendix,
- test_render_template_within_a_template_with_other_format,
- test_render_text,
- test_render_text_with_assigns,
- test_render_text_with_false,
- test_render_text_with_nil,
- test_render_text_with_resource,
- test_render_to_string,
- test_render_to_string_and_render,
- test_render_to_string_and_render_with_different_formats,
- test_render_to_string_doesnt_break_assigns,
- test_render_to_string_inline,
- test_render_to_string_partial,
- test_render_to_string_resets_assigns,
- test_render_to_string_that_throws_caught_exception_doesnt_break_assigns,
- test_render_to_string_with_template_and_html_partial,
- test_render_with_explicit_string_template,
- test_render_with_explicit_template,
- test_render_with_explicit_unescaped_template,
- test_render_with_filters,
- test_render_with_forward_slash,
- test_render_xml,
- test_render_xml_as_string_template,
- test_render_xml_with_default,
- test_render_xml_with_layouts,
- test_render_xml_with_partial,
- test_rendering_nothing_on_layout,
- test_rendering_with_conflicting_local_vars,
- test_rendering_without_layout,
- test_renders_default_template_for_missing_action,
- test_should_implicitly_render_html_template_from_xhr_request,
- test_should_implicitly_render_js_template_without_layout,
- test_should_render_formatted_html_erb_template,
- test_should_render_formatted_html_erb_template_with_faulty_accepts_header,
- test_should_render_formatted_template,
- test_should_render_html_formatted_partial,
- test_should_render_html_partial_with_formats,
- test_simple_show,
- test_template_with_locals,
- test_using_layout_around_block,
- test_using_layout_around_block_in_main_layout_and_within_content_for_layout,
- test_yield_content_for
Instance Public methods
setup()
Link
# 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()
Link
:ported:
test_access_to_controller_name_in_view()
Link
:ported:
test_access_to_logger_in_view()
Link
test_access_to_request_in_view()
Link
:ported:
test_accessing_local_assigns_in_inline_template()
Link
# 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()
Link
test_accessing_params_in_template_with_layout()
Link
test_action_talk_to_layout()
Link
test_attempt_to_access_object_method()
Link
:ported:
test_bad_render_to_string_still_throws_exception()
Link
test_do_with_render_action_and_layout_false()
Link
:ported:
test_do_with_render_text_and_layout()
Link
:ported:
test_double_redirect()
Link
test_double_render()
Link
:ported:
test_empty_partial_collection()
Link
test_hash_partial_collection()
Link
test_head_created()
Link
test_head_created_with_application_json_content_type()
Link
# 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()
Link
test_head_with_integer_status()
Link
test_head_with_location_header()
Link
test_head_with_location_object()
Link
# 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()
Link
# 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()
Link
test_head_with_symbolic_status()
Link
# 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()
Link
test_layout_overriding_layout()
Link
test_layout_rendering()
Link
:ported:
test_layout_test_with_different_layout()
Link
test_layout_test_with_different_layout_and_string_action()
Link
test_layout_test_with_different_layout_and_symbol_action()
Link
test_line_offset()
Link
# 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()
Link
# 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()
Link
test_nested_partial_with_form_builder()
Link
test_nested_rendering()
Link
:ported:
test_overwritting_rendering_relative_file_with_extension()
Link
# 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()
Link
test_partial_collection_shorthand_with_different_types_of_records()
Link
# 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()
Link
# 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()
Link
test_partial_collection_with_as_and_counter()
Link
test_partial_collection_with_counter()
Link
test_partial_collection_with_locals()
Link
test_partial_collection_with_spacer()
Link
test_partial_hash_collection_with_locals()
Link
test_partial_only()
Link
test_partial_with_counter()
Link
test_partial_with_form_builder()
Link
test_partial_with_form_builder_subclass()
Link
test_partial_with_hash_object()
Link
test_partial_with_locals()
Link
test_partial_with_nested_object()
Link
test_partial_with_nested_object_shorthand()
Link
test_partials_list()
Link
test_private_methods()
Link
:ported:
test_render()
Link
:ported:
test_render_action()
Link
:ported:
test_render_action_hello_world_as_string()
Link
:ported:
test_render_action_upcased()
Link
test_render_action_with_symbol()
Link
:ported:
test_render_and_redirect()
Link
test_render_call_to_partial_with_layout()
Link
test_render_call_to_partial_with_layout_in_main_layout_and_within_content_for_layout()
Link
# 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()
Link
:ported:
test_render_file()
Link
test_render_file_as_string_with_instance_variables()
Link
:ported:
test_render_file_as_string_with_locals()
Link
:ported:
test_render_file_from_template()
Link
:assessed:
test_render_file_not_using_full_path()
Link
:ported:
test_render_file_not_using_full_path_with_dot_in_path()
Link
:ported:
test_render_file_using_pathname()
Link
:ported:
test_render_file_with_instance_variables()
Link
:ported:
test_render_file_with_locals()
Link
:ported:
test_render_from_variable()
Link
:ported:
test_render_html_formatted_partial_even_with_other_mime_time_in_accept()
Link
# 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()
Link
:ported:
test_render_in_top_directory_with_slash()
Link
:ported:
test_render_missing_partial_template()
Link
test_render_nothing_with_appendix()
Link
:ported:
test_render_template_within_a_template_with_other_format()
Link
# 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()
Link
:ported:
test_render_text_with_assigns()
Link
:addressed:
test_render_text_with_false()
Link
:ported:
test_render_text_with_nil()
Link
:ported:
test_render_text_with_resource()
Link
test_render_to_string()
Link
test_render_to_string_and_render()
Link
specify the one exception to double render rule - render_to_string followed by render
test_render_to_string_and_render_with_different_formats()
Link
# 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()
Link
test_render_to_string_inline()
Link
test_render_to_string_partial()
Link
# 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()
Link
test_render_to_string_that_throws_caught_exception_doesnt_break_assigns()
Link
# 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()
Link
# 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()
Link
test_render_with_explicit_template()
Link
test_render_with_explicit_unescaped_template()
Link
# 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()
Link
test_render_with_forward_slash()
Link
:ported: compatibility
test_render_xml()
Link
:ported:
test_render_xml_as_string_template()
Link
: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()
Link
:ported:
test_render_xml_with_layouts()
Link
test_render_xml_with_partial()
Link
:move: test in AV
test_rendering_nothing_on_layout()
Link
test_rendering_with_conflicting_local_vars()
Link
test_rendering_without_layout()
Link
test_renders_default_template_for_missing_action()
Link
:ported:
test_should_implicitly_render_html_template_from_xhr_request()
Link
test_should_implicitly_render_js_template_without_layout()
Link
test_should_render_formatted_html_erb_template()
Link
test_should_render_formatted_html_erb_template_with_faulty_accepts_header()
Link
# 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()
Link
test_should_render_html_formatted_partial()
Link
test_should_render_html_partial_with_formats()
Link
test_simple_show()
Link
:ported:
test_template_with_locals()
Link
:ported:
test_using_layout_around_block()
Link
test_using_layout_around_block_in_main_layout_and_within_content_for_layout()
Link
# 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