aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-03-18 10:12:41 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-03-18 11:10:52 -0700
commitc555e28a4cf3690a95b5ed108d174f39cedd19b1 (patch)
tree4c089513e5fb87ce11790ae55c0f04f3f8a70e9b /actionview/test
parent98d0f93506b0b97804d0d510ffcc435af9b2a2d5 (diff)
downloadrails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.tar.gz
rails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.tar.bz2
rails-c555e28a4cf3690a95b5ed108d174f39cedd19b1.zip
Ignore nil in LookupContext#formats=
This also removes the mutation we were performing on the values being passed in.
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/lookup_context_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb
index 537f8ee163..8b61302c32 100644
--- a/actionview/test/template/lookup_context_test.rb
+++ b/actionview/test/template/lookup_context_test.rb
@@ -65,6 +65,11 @@ class LookupContextTest < ActiveSupport::TestCase
assert_equal Mime::SET.to_a, @lookup_context.formats
end
+ test "ignores nil format" do
+ @lookup_context.formats = [:html, nil, :text]
+ assert_equal [:html, :text], @lookup_context.formats
+ end
+
test "handles explicitly defined */* formats fallback to :js" do
@lookup_context.formats = [:js, Mime::ALL]
assert_equal [:js, *Mime::SET.symbols], @lookup_context.formats