Namespace
Methods
- N
- R
- S
- T
-
- test_basic_template,
- test_basic_template_does_html_escape,
- test_default_external_works,
- test_encoding_can_be_specified_with_magic_comment,
- test_encoding_can_be_specified_with_magic_comment_in_erb,
- test_error_when_template_isnt_valid_utf8,
- test_locals,
- test_lying_with_magic_comment,
- test_no_magic_comment_word_with_utf_8,
- test_refresh_raises_an_error_without_virtual_path,
- test_refresh_with_partials,
- test_refresh_with_templates,
- test_restores_buffer,
- test_resulting_string_is_utf8,
- test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a_virtual_path,
- test_template_loses_its_source_after_rendering,
- test_text_template_does_not_html_escape,
- test_virtual_path
- W
Constants
| ERBHandler | = | ActionView::Template::Handlers::ERB.new |
Instance Public methods
new_template(body = "<%= hello %>", details = { :format => :html })
Link
render(locals = {})
Link
setup()
Link
test_basic_template()
Link
test_basic_template_does_html_escape()
Link
test_default_external_works()
Link
This test ensures that if the default_external is set to something other than UTF-8, we don't get any errors and get back a UTF-8 String.
test_encoding_can_be_specified_with_magic_comment()
Link
test_encoding_can_be_specified_with_magic_comment_in_erb()
Link
# File actionpack/test/template/template_test.rb, line 172 def test_encoding_can_be_specified_with_magic_comment_in_erb with_external_encoding Encoding::UTF_8 do @template = new_template("<%# encoding: ISO-8859-1 %>hello \xFCmlat", :virtual_path => nil) assert_equal Encoding::UTF_8, render.encoding assert_equal "hello \u{fc}mlat", render end end
test_error_when_template_isnt_valid_utf8()
Link
# File actionpack/test/template/template_test.rb, line 180 def test_error_when_template_isnt_valid_utf8 exception = assert_raise(ActionView::Template::Error) do @template = new_template("hello \xFCmlat", :virtual_path => nil) render end assert_match(/\xFC/, exception.message) end
test_locals()
Link
test_lying_with_magic_comment()
Link
test_no_magic_comment_word_with_utf_8()
Link
test_refresh_raises_an_error_without_virtual_path()
Link
test_refresh_with_partials()
Link
# File actionpack/test/template/template_test.rb, line 119 def test_refresh_with_partials @template = new_template("Hello", :virtual_path => "test/_foo") @template.locals = [:key] @context.lookup_context.expects(:find_template).with("foo", %w(test), true, [:key]).returns("partial") assert_equal "partial", @template.refresh(@context) end
test_refresh_with_templates()
Link
# File actionpack/test/template/template_test.rb, line 112 def test_refresh_with_templates @template = new_template("Hello", :virtual_path => "test/foo/bar") @template.locals = [:key] @context.lookup_context.expects(:find_template).with("bar", %w(test/foo), false, [:key]).returns("template") assert_equal "template", @template.refresh(@context) end
test_restores_buffer()
Link
test_resulting_string_is_utf8()
Link
test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a_virtual_path()
Link
test_template_loses_its_source_after_rendering()
Link
test_text_template_does_not_html_escape()
Link
test_virtual_path()
Link
with_external_encoding(encoding)
Link
# File actionpack/test/template/template_test.rb, line 188 def with_external_encoding(encoding) old = Encoding.default_external Encoding::Converter.new old, encoding if old != encoding silence_warnings { Encoding.default_external = encoding } yield ensure silence_warnings { Encoding.default_external = old } end