diff options
author | John Hawthorn <john@hawthorn.email> | 2019-04-04 12:48:52 -0700 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2019-04-04 15:07:14 -0700 |
commit | 151cac65f12e4718317f39254f6a7ccea4ade25b (patch) | |
tree | e88b7b6a27fada104968f72d9de66fee72d6a28e /actionview/test | |
parent | db1830a7ec5765909fadb80a8725e52cc37ade07 (diff) | |
download | rails-151cac65f12e4718317f39254f6a7ccea4ade25b.tar.gz rails-151cac65f12e4718317f39254f6a7ccea4ade25b.tar.bz2 rails-151cac65f12e4718317f39254f6a7ccea4ade25b.zip |
Deprecate Template#refresh
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/template_test.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb index 5ccddb3e9e..049e0bc129 100644 --- a/actionview/test/template/template_test.rb +++ b/actionview/test/template/template_test.rb @@ -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 |