diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-16 02:10:36 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-16 02:10:36 +0200 |
commit | 2dd43c3f804176d114cdbfeb8a0f92a43155baee (patch) | |
tree | 04e0669c9c4958baa1289d79431553fb15a0f31e /actionpack/test | |
parent | fad214b9e1c0a66f8fecde48fbd8d122e5c51e33 (diff) | |
download | rails-2dd43c3f804176d114cdbfeb8a0f92a43155baee.tar.gz rails-2dd43c3f804176d114cdbfeb8a0f92a43155baee.tar.bz2 rails-2dd43c3f804176d114cdbfeb8a0f92a43155baee.zip |
Buffer should be an option passed down to template rendering.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/lookup_context_test.rb | 25 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/template/template_test.rb | 38 |
3 files changed, 0 insertions, 72 deletions
diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index 8d063e66b0..ff94cba59f 100644 --- a/actionpack/test/template/lookup_context_test.rb +++ b/actionpack/test/template/lookup_context_test.rb @@ -180,16 +180,6 @@ class LookupContextTest < ActiveSupport::TestCase assert_not_equal template, old_template end - - test "data can be stored in cached templates" do - template = @lookup_context.find("hello_world", %w(test)) - template.data["cached"] = "data" - assert_equal "Hello world!", template.source - - template = @lookup_context.find("hello_world", %w(test)) - assert_equal "data", template.data["cached"] - assert_equal "Hello world!", template.source - end end class LookupContextWithFalseCaching < ActiveSupport::TestCase @@ -235,21 +225,6 @@ class LookupContextWithFalseCaching < ActiveSupport::TestCase template = @lookup_context.find("foo", %w(test), true) assert_equal "Foo", template.source end - - test "data can be stored as long as template was not updated" do - template = @lookup_context.find("foo", %w(test), true) - template.data["cached"] = "data" - assert_equal "Foo", template.source - - template = @lookup_context.find("foo", %w(test), true) - assert_equal "data", template.data["cached"] - assert_equal "Foo", template.source - - @resolver.hash["test/_foo.erb"][1] = Time.now.utc - template = @lookup_context.find("foo", %w(test), true) - assert_nil template.data["cached"] - assert_equal "Foo", template.source - end end class TestMissingTemplate < ActiveSupport::TestCase diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index bce11c4dd3..d4e912c410 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -227,20 +227,11 @@ module RenderTestCases "@output_buffer << 'source: #{template.source.inspect}'\n" end - WithViewHandler = lambda do |template, view| - %'"#{template.class} #{view.class}"' - end - 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) end - def test_render_inline_with_template_handler_with_view - ActionView::Template.register_template_handler :with_view, WithViewHandler - assert_equal 'ActionView::Template ActionView::Base', @view.render(:inline => "Hello, World!", :type => :with_view) - end - 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) diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb index 3432a02c3c..5c655d5b69 100644 --- a/actionpack/test/template/template_test.rb +++ b/actionpack/test/template/template_test.rb @@ -113,44 +113,6 @@ class TestERBTemplate < ActiveSupport::TestCase end end - def test_template_expire_sets_the_timestamp_to_1970 - @template = new_template("Hello", :updated_at => Time.utc(2010)) - assert_equal Time.utc(2010), @template.updated_at - @template.expire! - assert_equal Time.utc(1970), @template.updated_at - end - - def test_template_rerender_renders_a_template_like_self - @template = new_template("Hello", :virtual_path => "test/foo_bar") - @context.expects(:render).with(:template => "test/foo_bar").returns("template") - assert_equal "template", @template.rerender(@context) - end - - def test_template_rerender_renders_a_root_template_like_self - @template = new_template("Hello", :virtual_path => "foo_bar") - @context.expects(:render).with(:template => "foo_bar").returns("template") - assert_equal "template", @template.rerender(@context) - end - - def test_template_rerender_renders_a_partial_like_self - @template = new_template("Hello", :virtual_path => "test/_foo_bar") - @context.expects(:render).with(:partial => "test/foo_bar").returns("partial") - assert_equal "partial", @template.rerender(@context) - end - - def test_template_rerender_renders_a_root_partial_like_self - @template = new_template("Hello", :virtual_path => "_foo_bar") - @context.expects(:render).with(:partial => "foo_bar").returns("partial") - assert_equal "partial", @template.rerender(@context) - end - - def test_rerender_raises_an_error_without_virtual_path - @template = new_template("Hello", :virtual_path => nil) - assert_raise RuntimeError do - @template.rerender(@context) - end - end - if "ruby".encoding_aware? def test_resulting_string_is_utf8 @template = new_template |