Methods
- S
- T
-
- test_render_body,
- test_render_does_not_use_unregistered_extension_and_template_handler,
- test_render_error_indentation,
- test_render_fallbacks_to_erb_for_unknown_types,
- test_render_file,
- test_render_file_at_top_level,
- test_render_file_not_using_full_path_with_dot_in_path,
- test_render_file_with_dashed_locale,
- test_render_file_with_errors,
- test_render_file_with_format,
- test_render_file_with_full_path,
- test_render_file_with_handlers,
- test_render_file_with_instance_variables,
- test_render_file_with_locale,
- test_render_file_with_localization_on_context_level,
- test_render_file_with_locals,
- test_render_ignores_templates_with_malformed_template_handlers,
- test_render_inline,
- test_render_inline_with_compilable_custom_type,
- test_render_inline_with_locals,
- test_render_inline_with_locals_and_compilable_custom_type,
- test_render_inline_with_render_from_to_proc,
- test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization,
- test_render_layout_with_a_nested_render_layout_call,
- test_render_layout_with_a_nested_render_layout_call_using_block_with_render_content,
- test_render_layout_with_a_nested_render_layout_call_using_block_with_render_partial,
- test_render_layout_with_block_and_other_partial_inside,
- test_render_layout_with_block_and_yield,
- test_render_layout_with_block_and_yield_with_params,
- test_render_layout_with_block_which_renders_another_partial_and_yields,
- test_render_layout_with_object,
- test_render_missing_xml_partial_and_raise_missing_template,
- test_render_object,
- test_render_object_with_array,
- test_render_outside_path,
- test_render_partial,
- test_render_partial_and_fallback_to_layout,
- test_render_partial_and_layout_without_block_with_locals,
- test_render_partial_and_layout_without_block_with_locals_and_rendering_another_partial,
- test_render_partial_at_top_level,
- test_render_partial_collection,
- test_render_partial_collection_as_by_string,
- test_render_partial_collection_as_by_symbol,
- test_render_partial_collection_without_as,
- test_render_partial_from_default,
- test_render_partial_implicitly_use_format_of_the_rendered_partial,
- test_render_partial_implicitly_use_format_of_the_rendered_template,
- test_render_partial_use_last_prepended_format_for_partials_with_the_same_names,
- test_render_partial_using_collection,
- test_render_partial_using_collection_without_path,
- test_render_partial_using_object,
- test_render_partial_using_string,
- test_render_partial_with_empty_array_should_return_nil,
- test_render_partial_with_empty_collection_should_return_nil,
- test_render_partial_with_errors,
- test_render_partial_with_format,
- test_render_partial_with_format_at_top_level,
- test_render_partial_with_hyphen,
- test_render_partial_with_hyphen_and_invalid_option_as,
- test_render_partial_with_incompatible_object,
- test_render_partial_with_invalid_name,
- test_render_partial_with_invalid_option_as,
- test_render_partial_with_layout_raises_descriptive_error,
- test_render_partial_with_layout_using_collection_and_template,
- test_render_partial_with_layout_using_collection_and_template_makes_current_item_available_in_layout,
- test_render_partial_with_layout_using_collection_and_template_makes_current_item_counter_available_in_layout,
- test_render_partial_with_layout_using_object_and_template_makes_object_available_in_layout,
- test_render_partial_with_locals,
- test_render_partial_with_locals_from_default,
- test_render_partial_with_locals_using_string,
- test_render_partial_with_missing_filename,
- test_render_partial_with_nil_collection_should_return_nil,
- test_render_partial_with_nil_values_in_collection,
- test_render_partial_with_object_and_format_uses_render_partial_path,
- test_render_partial_with_object_uses_render_partial_path,
- test_render_partial_with_selected_format,
- test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable,
- test_render_plain,
- test_render_raw_template_with_handlers,
- test_render_raw_template_with_quotes,
- test_render_ruby_template_inline,
- test_render_ruby_template_with_handlers,
- test_render_sub_template_with_errors,
- test_render_template_with_a_missing_partial_of_another_format,
- test_render_template_with_format,
- test_render_template_with_handlers,
- test_render_template_with_locale,
- test_render_throws_exception_when_no_extensions_passed_to_register_template_handler_function_call,
- test_render_with_file_in_layout,
- test_render_with_layout,
- test_render_with_layout_which_has_render_inline,
- test_render_with_layout_which_renders_another_partial,
- test_render_with_nested_layout,
- test_render_with_passing_couple_extensions_to_one_register_template_handler_function_call,
- test_render_with_permitted_strong_parameters,
- test_render_with_strong_parameters,
- test_render_without_options,
- test_rendered_format_without_format
Constants
| CustomHandler | = | lambda do |template| "@output_buffer = ''\n" + "@output_buffer << 'source: #{template.source.inspect}'\n" end |
Instance Public methods
setup_view(paths)
Link
# File actionview/test/template/render_test.rb, line 8 def setup_view(paths) @assigns = { :secret => 'in the sauce' } @view = ActionView::Base.new(paths, @assigns) @controller_view = TestController.new.view_context # Reload and register danish language for testing I18n.backend.store_translations 'da', {} I18n.backend.store_translations 'pt-BR', {} # Ensure original are still the same since we are reindexing view paths assert_equal ORIGINAL_LOCALES, I18n.available_locales.map {|l| l.to_s }.sort end
test_render_body()
Link
test_render_does_not_use_unregistered_extension_and_template_handler()
Link
# File actionview/test/template/render_test.rb, line 452 def test_render_does_not_use_unregistered_extension_and_template_handler ActionView::Template.register_template_handler :foo, CustomHandler ActionView::Template.unregister_template_handler :foo assert_not ActionView::Template::Handlers.extensions.include?(:foo) assert_equal "Hello, World!", @view.render(inline: "Hello, World!", type: :foo) ensure ActionView::Template::Handlers.class_variable_get(:@@template_handlers).delete(:foo) end
test_render_error_indentation()
Link
# File actionview/test/template/render_test.rb, line 249 def test_render_error_indentation e = assert_raises(ActionView::Template::Error) { @view.render(:partial => "test/raise_indentation") } error_lines = e.annoted_source_code.split("\n") assert_match %r!error\shere!, e.message assert_equal "11", e.line_number assert_equal " 9: <p>Ninth paragraph</p>", error_lines.second assert_equal " 10: <p>Tenth paragraph</p>", error_lines.third end
test_render_fallbacks_to_erb_for_unknown_types()
Link
test_render_file()
Link
test_render_file_at_top_level()
Link
test_render_file_not_using_full_path_with_dot_in_path()
Link
test_render_file_with_dashed_locale()
Link
test_render_file_with_errors()
Link
# File actionview/test/template/render_test.rb, line 266 def test_render_file_with_errors e = assert_raises(ActionView::Template::Error) { @view.render(:file => File.expand_path("test/_raise", FIXTURE_LOAD_PATH)) } assert_match %r!method.*doesnt_exist!, e.message assert_equal "", e.sub_template_message assert_equal "1", e.line_number assert_equal "1: <%= doesnt_exist %>", e.annoted_source_code.strip assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name end
test_render_file_with_format()
Link
Test if :formats, :locale etc. options are passed correctly to the resolvers.
# File actionview/test/template/render_test.rb, line 31 def test_render_file_with_format assert_match "<h1>No Comment</h1>", @view.render(:file => "comments/empty", :formats => [:html]) assert_match "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => [:xml]) assert_match "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => :xml) end
test_render_file_with_full_path()
Link
test_render_file_with_handlers()
Link
# File actionview/test/template/render_test.rb, line 78 def test_render_file_with_handlers assert_equal "<h1>No Comment</h1>\n", @view.render(:file => "comments/empty", :handlers => [:builder]) assert_equal "<h1>No Comment</h1>\n", @view.render(:file => "comments/empty", :handlers => :builder) end
test_render_file_with_instance_variables()
Link
test_render_file_with_locale()
Link
# File actionview/test/template/render_test.rb, line 69 def test_render_file_with_locale assert_equal "<h1>Kein Kommentar</h1>", @view.render(:file => "comments/empty", :locale => [:de]) assert_equal "<h1>Kein Kommentar</h1>", @view.render(:file => "comments/empty", :locale => :de) end
test_render_file_with_localization_on_context_level()
Link
test_render_file_with_locals()
Link
test_render_ignores_templates_with_malformed_template_handlers()
Link
# File actionview/test/template/render_test.rb, line 461 def test_render_ignores_templates_with_malformed_template_handlers ActiveSupport::Deprecation.silence do %w(malformed malformed.erb malformed.html.erb malformed.en.html.erb).each do |name| assert File.exist?(File.expand_path("#{FIXTURE_LOAD_PATH}/test/malformed/#{name}~")), "Malformed file (#{name}~) which should be ignored does not exists" assert_raises(ActionView::MissingTemplate) { @view.render(:file => "test/malformed/#{name}") } end end end
test_render_inline()
Link
test_render_inline_with_compilable_custom_type()
Link
# File actionview/test/template/render_test.rb, line 422 def test_render_inline_with_compilable_custom_type ActionView::Template.register_template_handler :foo, CustomHandler assert_equal 'source: "Hello, World!"', @view.render(inline: "Hello, World!", type: :foo) ensure ActionView::Template.unregister_template_handler :foo end
test_render_inline_with_locals()
Link
test_render_inline_with_locals_and_compilable_custom_type()
Link
# File actionview/test/template/render_test.rb, line 429 def test_render_inline_with_locals_and_compilable_custom_type ActionView::Template.register_template_handler :foo, CustomHandler assert_equal 'source: "Hello, <%= name %>!"', @view.render(inline: "Hello, <%= name %>!", locals: { name: "Josh" }, type: :foo) ensure ActionView::Template.unregister_template_handler :foo end
test_render_inline_with_render_from_to_proc()
Link
# File actionview/test/template/render_test.rb, line 415 def test_render_inline_with_render_from_to_proc ActionView::Template.register_template_handler :ruby_handler, :source.to_proc assert_equal '3', @view.render(inline: "(1 + 2).to_s", type: :ruby_handler) ensure ActionView::Template.unregister_template_handler :ruby_handler end
test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization()
Link
# File actionview/test/template/render_test.rb, line 444 def test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization ActionView::Template::Handlers.extensions ActionView::Template.register_template_handler :foo, CustomHandler assert ActionView::Template::Handlers.extensions.include?(:foo) ensure ActionView::Template.unregister_template_handler :foo end
test_render_layout_with_a_nested_render_layout_call()
Link
# File actionview/test/template/render_test.rb, line 510 def test_render_layout_with_a_nested_render_layout_call assert_equal %Q(Before (Foo!)\nBefore (Bar!)\npartial html\nAfter\npartial with layout\n\nAfter), @view.render(:partial => 'test/partial_with_layout', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end
test_render_layout_with_a_nested_render_layout_call_using_block_with_render_content()
Link
# File actionview/test/template/render_test.rb, line 520 def test_render_layout_with_a_nested_render_layout_call_using_block_with_render_content assert_equal %Q(Before (Foo!)\nBefore (Bar!)\n\n Content from inside layout!\n\nAfterpartial with layout\n\nAfter), @view.render(:partial => 'test/partial_with_layout_block_content', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end
test_render_layout_with_a_nested_render_layout_call_using_block_with_render_partial()
Link
# File actionview/test/template/render_test.rb, line 515 def test_render_layout_with_a_nested_render_layout_call_using_block_with_render_partial assert_equal %Q(Before (Foo!)\nBefore (Bar!)\n\n partial html\n\nAfterpartial with layout\n\nAfter), @view.render(:partial => 'test/partial_with_layout_block_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end
test_render_layout_with_block_and_other_partial_inside()
Link
test_render_layout_with_block_and_yield()
Link
test_render_layout_with_block_and_yield_with_params()
Link
test_render_layout_with_block_which_renders_another_partial_and_yields()
Link
test_render_layout_with_object()
Link
test_render_missing_xml_partial_and_raise_missing_template()
Link
TODO: The reason for this test is unclear, improve documentation
test_render_object()
Link
# File actionview/test/template/render_test.rb, line 275 def test_render_object assert_equal "Hello: david", @view.render(:partial => "test/customer", :object => Customer.new("david")) assert_equal "FalseClass", @view.render(:partial => "test/klass", :object => false) assert_equal "NilClass", @view.render(:partial => "test/klass", :object => nil) end
test_render_object_with_array()
Link
test_render_outside_path()
Link
# File actionview/test/template/render_test.rb, line 143 def test_render_outside_path assert File.exist?(File.join(File.dirname(__FILE__), '../../test/abstract_unit.rb')) assert_raises ActionView::MissingTemplate do @view.render(:template => "../\\../test/abstract_unit.rb") end end
test_render_partial()
Link
test_render_partial_and_fallback_to_layout()
Link
TODO: The reason for this test is unclear, improve documentation
test_render_partial_and_layout_without_block_with_locals()
Link
# File actionview/test/template/render_test.rb, line 500 def test_render_partial_and_layout_without_block_with_locals assert_equal %Q(Before (Foo!)\npartial html\nAfter), @view.render(:partial => 'test/partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end
test_render_partial_and_layout_without_block_with_locals_and_rendering_another_partial()
Link
# File actionview/test/template/render_test.rb, line 505 def test_render_partial_and_layout_without_block_with_locals_and_rendering_another_partial assert_equal %Q(Before (Foo!)\npartial html\npartial with partial\n\nAfter), @view.render(:partial => 'test/partial_with_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end
test_render_partial_at_top_level()
Link
test_render_partial_collection()
Link
test_render_partial_collection_as_by_string()
Link
# File actionview/test/template/render_test.rb, line 289 def test_render_partial_collection_as_by_string assert_equal "david david davidmary mary mary", @view.render(:partial => "test/customer_with_var", :collection => [ Customer.new("david"), Customer.new("mary") ], :as => 'customer') end
test_render_partial_collection_as_by_symbol()
Link
# File actionview/test/template/render_test.rb, line 294 def test_render_partial_collection_as_by_symbol assert_equal "david david davidmary mary mary", @view.render(:partial => "test/customer_with_var", :collection => [ Customer.new("david"), Customer.new("mary") ], :as => :customer) end
test_render_partial_collection_without_as()
Link
# File actionview/test/template/render_test.rb, line 299 def test_render_partial_collection_without_as assert_equal "local_inspector,local_inspector_counter,local_inspector_iteration", @view.render(:partial => "test/local_inspector", :collection => [ Customer.new("mary") ]) end
test_render_partial_from_default()
Link
test_render_partial_implicitly_use_format_of_the_rendered_partial()
Link
test_render_partial_implicitly_use_format_of_the_rendered_template()
Link
test_render_partial_use_last_prepended_format_for_partials_with_the_same_names()
Link
# File actionview/test/template/render_test.rb, line 57 def test_render_partial_use_last_prepended_format_for_partials_with_the_same_names @view.lookup_context.formats = [:html] assert_equal "\nHTML Template, but JSON partial", @view.render(:template => "test/change_priority") end
test_render_partial_using_collection()
Link
test_render_partial_using_collection_without_path()
Link
test_render_partial_using_object()
Link
test_render_partial_using_string()
Link
test_render_partial_with_empty_array_should_return_nil()
Link
test_render_partial_with_empty_collection_should_return_nil()
Link
test_render_partial_with_errors()
Link
# File actionview/test/template/render_test.rb, line 240 def test_render_partial_with_errors e = assert_raises(ActionView::Template::Error) { @view.render(:partial => "test/raise") } assert_match %r!method.*doesnt_exist!, e.message assert_equal "", e.sub_template_message assert_equal "1", e.line_number assert_equal "1: <%= doesnt_exist %>", e.annoted_source_code.strip assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name end
test_render_partial_with_format()
Link
test_render_partial_with_format_at_top_level()
Link
# File actionview/test/template/render_test.rb, line 187 def test_render_partial_with_format_at_top_level # file fixtures/_top_level_partial.html (not fixtures/test, with format extension) assert_equal 'top level partial html', @view.render(:partial => '/top_level_partial') end
test_render_partial_with_hyphen()
Link
# File actionview/test/template/render_test.rb, line 219 def test_render_partial_with_hyphen e = assert_raises(ArgumentError) { @view.render(:partial => "test/a-in") } assert_equal "The partial name (test/a-in) is not a valid Ruby identifier; " + "make sure your partial name starts with underscore, " + "and is followed by any combination of letters, numbers and underscores.", e.message end
test_render_partial_with_hyphen_and_invalid_option_as()
Link
# File actionview/test/template/render_test.rb, line 233 def test_render_partial_with_hyphen_and_invalid_option_as e = assert_raises(ArgumentError) { @view.render(:partial => "test/a-in", :as => 'a-in') } assert_equal "The value (a-in) of the option `as` is not a valid Ruby identifier; " + "make sure it starts with lowercase letter, " + "and is followed by any combination of letters, numbers and underscores.", e.message end
test_render_partial_with_incompatible_object()
Link
# File actionview/test/template/render_test.rb, line 214 def test_render_partial_with_incompatible_object e = assert_raises(ArgumentError) { @view.render(:partial => nil) } assert_equal "'#{nil.inspect}' is not an ActiveModel-compatible object. It must implement :to_partial_path.", e.message end
test_render_partial_with_invalid_name()
Link
# File actionview/test/template/render_test.rb, line 200 def test_render_partial_with_invalid_name e = assert_raises(ArgumentError) { @view.render(:partial => "test/200") } assert_equal "The partial name (test/200) is not a valid Ruby identifier; " + "make sure your partial name starts with underscore, " + "and is followed by any combination of letters, numbers and underscores.", e.message end
test_render_partial_with_invalid_option_as()
Link
# File actionview/test/template/render_test.rb, line 226 def test_render_partial_with_invalid_option_as e = assert_raises(ArgumentError) { @view.render(:partial => "test/partial_only", :as => 'a-in') } assert_equal "The value (a-in) of the option `as` is not a valid Ruby identifier; " + "make sure it starts with lowercase letter, " + "and is followed by any combination of letters, numbers and underscores.", e.message end
test_render_partial_with_layout_raises_descriptive_error()
Link
# File actionview/test/template/render_test.rb, line 525 def test_render_partial_with_layout_raises_descriptive_error e = assert_raises(ActionView::MissingTemplate) { @view.render(partial: 'test/partial', layout: true) } assert_match "Missing partial /_true with", e.message end
test_render_partial_with_layout_using_collection_and_template()
Link
# File actionview/test/template/render_test.rb, line 316 def test_render_partial_with_layout_using_collection_and_template assert_equal "<b>Hello: Amazon</b><b>Hello: Yahoo</b>", @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial', :collection => [ Customer.new("Amazon"), Customer.new("Yahoo") ]) end
test_render_partial_with_layout_using_collection_and_template_makes_current_item_available_in_layout()
Link
# File actionview/test/template/render_test.rb, line 320 def test_render_partial_with_layout_using_collection_and_template_makes_current_item_available_in_layout assert_equal '<b class="amazon">Hello: Amazon</b><b class="yahoo">Hello: Yahoo</b>', @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial_with_object', :collection => [ Customer.new("Amazon"), Customer.new("Yahoo") ]) end
test_render_partial_with_layout_using_collection_and_template_makes_current_item_counter_available_in_layout()
Link
# File actionview/test/template/render_test.rb, line 325 def test_render_partial_with_layout_using_collection_and_template_makes_current_item_counter_available_in_layout assert_equal '<b data-counter="0">Hello: Amazon</b><b data-counter="1">Hello: Yahoo</b>', @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial_with_object_counter', :collection => [ Customer.new("Amazon"), Customer.new("Yahoo") ]) end
test_render_partial_with_layout_using_object_and_template_makes_object_available_in_layout()
Link
# File actionview/test/template/render_test.rb, line 330 def test_render_partial_with_layout_using_object_and_template_makes_object_available_in_layout assert_equal '<b class="amazon">Hello: Amazon</b>', @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial_with_object', :object => Customer.new("Amazon")) end
test_render_partial_with_locals()
Link
test_render_partial_with_locals_from_default()
Link
test_render_partial_with_locals_using_string()
Link
test_render_partial_with_missing_filename()
Link
# File actionview/test/template/render_test.rb, line 207 def test_render_partial_with_missing_filename e = assert_raises(ArgumentError) { @view.render(:partial => "test/") } assert_equal "The partial name (test/) is not a valid Ruby identifier; " + "make sure your partial name starts with underscore, " + "and is followed by any combination of letters, numbers and underscores.", e.message end
test_render_partial_with_nil_collection_should_return_nil()
Link
test_render_partial_with_nil_values_in_collection()
Link
test_render_partial_with_object_and_format_uses_render_partial_path()
Link
# File actionview/test/template/render_test.rb, line 352 def test_render_partial_with_object_and_format_uses_render_partial_path assert_equal "<greeting>Hello</greeting><name>lifo</name>", @controller_view.render(:partial => Customer.new("lifo"), :formats => :xml, :locals => {:greeting => "Hello"}) end
test_render_partial_with_object_uses_render_partial_path()
Link
test_render_partial_with_selected_format()
Link
# File actionview/test/template/render_test.rb, line 177 def test_render_partial_with_selected_format assert_equal 'partial html', @view.render(:partial => 'test/partial', :formats => :html) assert_equal 'partial js', @view.render(:partial => 'test/partial', :formats => [:js]) end
test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable()
Link
# File actionview/test/template/render_test.rb, line 372 def test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable exception = assert_raises ActionView::Template::Error do @controller_view.render("partial_name_local_variable") end assert_instance_of NameError, exception.original_exception assert_equal :partial_name_local_variable, exception.original_exception.name end
test_render_plain()
Link
test_render_raw_template_with_handlers()
Link
test_render_raw_template_with_quotes()
Link
test_render_ruby_template_inline()
Link
test_render_ruby_template_with_handlers()
Link
test_render_sub_template_with_errors()
Link
# File actionview/test/template/render_test.rb, line 258 def test_render_sub_template_with_errors e = assert_raises(ActionView::Template::Error) { @view.render(:template => "test/sub_template_raise") } assert_match %r!method.*doesnt_exist!, e.message assert_equal "Trace of template inclusion: #{File.expand_path("#{FIXTURE_LOAD_PATH}/test/sub_template_raise.html.erb")}", e.sub_template_message assert_equal "1", e.line_number assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name end
test_render_template_with_a_missing_partial_of_another_format()
Link
# File actionview/test/template/render_test.rb, line 62 def test_render_template_with_a_missing_partial_of_another_format @view.lookup_context.formats = [:html] assert_raise ActionView::Template::Error, "Missing partial /_missing with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder]}" do @view.render(:template => "with_format", :formats => [:json]) end end
test_render_template_with_format()
Link
# File actionview/test/template/render_test.rb, line 37 def test_render_template_with_format assert_match "<h1>No Comment</h1>", @view.render(:template => "comments/empty", :formats => [:html]) assert_match "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml]) end
test_render_template_with_handlers()
Link
test_render_template_with_locale()
Link
test_render_throws_exception_when_no_extensions_passed_to_register_template_handler_function_call()
Link
test_render_with_file_in_layout()
Link
test_render_with_layout()
Link
test_render_with_layout_which_has_render_inline()
Link
test_render_with_layout_which_renders_another_partial()
Link
test_render_with_nested_layout()
Link
test_render_with_passing_couple_extensions_to_one_register_template_handler_function_call()
Link
# File actionview/test/template/render_test.rb, line 545 def test_render_with_passing_couple_extensions_to_one_register_template_handler_function_call ActionView::Template.register_template_handler :foo1, :foo2, CustomHandler assert_equal @view.render(inline: "Hello, World!", type: :foo1), @view.render(inline: "Hello, World!", type: :foo2) ensure ActionView::Template.unregister_template_handler :foo1, :foo2 end
test_render_with_permitted_strong_parameters()
Link
test_render_with_strong_parameters()
Link
# File actionview/test/template/render_test.rb, line 150 def test_render_with_strong_parameters params = { :inline => '<%= RUBY_VERSION %>' } def params.permitted? false end e = assert_raises ArgumentError do @view.render(params) end assert_equal "render parameters are not permitted", e.message end
test_render_without_options()
Link