Methods
- S
- T
-
- teardown,
- 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_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_namespaced_object_partial,
- test_nested_partial_with_form_builder,
- test_nested_rendering,
- test_overwriting_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_as_and_iteration,
- test_partial_collection_with_counter,
- test_partial_collection_with_iteration,
- test_partial_collection_with_locals,
- test_partial_collection_with_spacer,
- test_partial_collection_with_spacer_which_uses_render,
- 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_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_assigns_option,
- 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_bad_accepts_header,
- 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 actionview/test/actionpack/controller/render_test.rb, line 667 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 = ActiveSupport::Logger.new(nil) ActionView::Base.logger = ActiveSupport::Logger.new(nil) @request.host = "www.nextangle.com" end
teardown()
Link
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 actionview/test/actionpack/controller/render_test.rb, line 959 def test_accessing_local_assigns_in_inline_template get :accessing_local_assigns_in_inline_template, params: { 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_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 actionview/test/actionpack/controller/render_test.rb, line 701 def test_line_offset exc = assert_raises ActionView::Template::Error do get :render_line_offset end 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
test_namespaced_object_partial()
Link
test_nested_partial_with_form_builder()
Link
test_nested_rendering()
Link
:ported:
test_overwriting_rendering_relative_file_with_extension()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 1120 def test_overwriting_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 actionview/test/actionpack/controller/render_test.rb, line 1276 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 end
test_partial_collection_shorthand_with_locals()
Link
test_partial_collection_with_as()
Link
test_partial_collection_with_as_and_counter()
Link
test_partial_collection_with_as_and_iteration()
Link
test_partial_collection_with_counter()
Link
test_partial_collection_with_iteration()
Link
test_partial_collection_with_locals()
Link
test_partial_collection_with_spacer()
Link
test_partial_collection_with_spacer_which_uses_render()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 1266 def test_partial_collection_with_spacer_which_uses_render get :partial_collection_with_spacer_which_uses_render assert_equal "Hello: davidpartial html\npartial with partial\nHello: mary", @response.body end
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 actionview/test/actionpack/controller/render_test.rb, line 1322 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_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 actionview/test/actionpack/controller/render_test.rb, line 1150 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 actionview/test/actionpack/controller/render_test.rb, line 1187 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_assigns_option()
Link
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 actionview/test/actionpack/controller/render_test.rb, line 1180 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", @controller.instance_variable_get(:@html) assert_equal "**only partial**\n", @response.body assert_equal "text/plain", @response.content_type end
test_render_to_string_doesnt_break_assigns()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 1027 def test_render_to_string_doesnt_break_assigns get :render_to_string_with_assigns assert_equal "i'm before the render", @controller.instance_variable_get(:@before) assert_equal "i'm after the render", @controller.instance_variable_get(:@after) end
test_render_to_string_inline()
Link
test_render_to_string_partial()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 1165 def test_render_to_string_partial get :render_to_string_with_partial assert_equal "only partial", @controller.instance_variable_get(:@partial_only) assert_equal "Hello: david", @controller.instance_variable_get(:@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 actionview/test/actionpack/controller/render_test.rb, line 1037 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", @controller.instance_variable_get(:@before) assert_equal "i'm after the render", @controller.instance_variable_get(:@after) end
test_render_to_string_with_template_and_html_partial()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 1172 def test_render_to_string_with_template_and_html_partial get :render_to_string_with_template_and_html_partial assert_equal "**only partial**\n", @controller.instance_variable_get(:@text) assert_equal "<strong>only partial</strong>\n", @controller.instance_variable_get(:@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 actionview/test/actionpack/controller/render_test.rb, line 1053 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 actionview/test/actionpack/controller/render_test.rb, line 898 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_bad_accepts_header()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 985 def test_should_render_formatted_html_erb_template_with_bad_accepts_header @request.env["HTTP_ACCEPT"] = "; a=dsf" 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()
Link
# File actionview/test/actionpack/controller/render_test.rb, line 991 def test_should_render_formatted_html_erb_template_with_faulty_accepts_header @request.accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/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 actionview/test/actionpack/controller/render_test.rb, line 1133 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