From 2f128a82e66f181577ff77d83d4ca02659aa8a8d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 25 Feb 2019 11:53:55 -0800 Subject: Always pass a format to the ActionView::Template constructor This means we can eliminate nil checks and remove some mutations from the `decorate` method. --- actionview/test/template/template_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionview/test/template') 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 -- cgit v1.2.3