diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 11:53:55 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2019-02-25 12:26:25 -0800 |
commit | 2f128a82e66f181577ff77d83d4ca02659aa8a8d (patch) | |
tree | f41df8766f0c46a4e55f404fb8450821feafb0e2 /actionview/test | |
parent | 5330a342852147ecd65a16f83bc51e688c8bb9eb (diff) | |
download | rails-2f128a82e66f181577ff77d83d4ca02659aa8a8d.tar.gz rails-2f128a82e66f181577ff77d83d4ca02659aa8a8d.tar.bz2 rails-2f128a82e66f181577ff77d83d4ca02659aa8a8d.zip |
Always pass a format to the ActionView::Template constructor
This means we can eliminate nil checks and remove some mutations from
the `decorate` method.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/abstract_unit.rb | 2 | ||||
-rw-r--r-- | actionview/test/template/template_test.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/actionview/test/abstract_unit.rb b/actionview/test/abstract_unit.rb index b649b3c9dd..e0a1f59755 100644 --- a/actionview/test/abstract_unit.rb +++ b/actionview/test/abstract_unit.rb @@ -60,7 +60,7 @@ module RenderERBUtils string.strip, "test template", ActionView::Template.handler_for_extension(:erb), - {}) + format: :html) view = ActionView::Base.with_empty_template_cache template.render(view.empty, {}).strip diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb index a069c8f2d0..36caef28c2 100644 --- a/actionview/test/template/template_test.rb +++ b/actionview/test/template/template_test.rb @@ -38,7 +38,8 @@ class TestERBTemplate < ActiveSupport::TestCase "<%= @virtual_path %>", "partial", ERBHandler, - virtual_path: "partial" + virtual_path: "partial", + format: :html ) end @@ -55,7 +56,8 @@ class TestERBTemplate < ActiveSupport::TestCase end end - def new_template(body = "<%= hello %>", details = { format: :html }) + def new_template(body = "<%= hello %>", details = {}) + details = { format: :html }.merge details ActionView::Template.new(body.dup, "hello template", details.fetch(:handler) { ERBHandler }, { virtual_path: "hello" }.merge!(details)) end |