aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/template_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/template_test.rb')
-rw-r--r--actionview/test/template/template_test.rb24
1 files changed, 5 insertions, 19 deletions
diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb
index 71fb99115b..049e0bc129 100644
--- a/actionview/test/template/template_test.rb
+++ b/actionview/test/template/template_test.rb
@@ -91,10 +91,10 @@ class TestERBTemplate < ActiveSupport::TestCase
assert_equal "<%= hello %>", render
end
- def test_template_loses_its_source_after_rendering
+ def test_template_does_not_lose_its_source_after_rendering
@template = new_template
render
- assert_nil @template.source
+ assert_equal "<%= hello %>", @template.source
end
def test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a_virtual_path
@@ -121,24 +121,10 @@ class TestERBTemplate < ActiveSupport::TestCase
assert_equal "hellopartialhello", render
end
- def test_refresh_with_templates
+ def test_refresh_is_deprecated
@template = new_template("Hello", virtual_path: "test/foo/bar", locals: [:key])
- assert_called_with(@context.lookup_context, :find_template, ["bar", %w(test/foo), false, [:key]], returns: "template") do
- assert_equal "template", @template.refresh(@context)
- end
- end
-
- def test_refresh_with_partials
- @template = new_template("Hello", virtual_path: "test/_foo", locals: [:key])
- assert_called_with(@context.lookup_context, :find_template, ["foo", %w(test), true, [:key]], returns: "partial") do
- assert_equal "partial", @template.refresh(@context)
- end
- end
-
- def test_refresh_raises_an_error_without_virtual_path
- @template = new_template("Hello", virtual_path: nil)
- assert_raise RuntimeError do
- @template.refresh(@context)
+ assert_deprecated do
+ assert_same @template, @template.refresh(@context)
end
end