diff options
-rw-r--r-- | actionview/lib/action_view/lookup_context.rb | 2 | ||||
-rw-r--r-- | actionview/test/template/lookup_context_test.rb | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index 336eaa0d8b..fd3d025cbf 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -280,7 +280,7 @@ module ActionView # add :html as fallback to :js. def formats=(values) if values - values = values.compact + values = values.dup values.concat(default_formats) if values.delete "*/*" values.uniq! diff --git a/actionview/test/template/lookup_context_test.rb b/actionview/test/template/lookup_context_test.rb index 6457e45920..3e357fe1a7 100644 --- a/actionview/test/template/lookup_context_test.rb +++ b/actionview/test/template/lookup_context_test.rb @@ -65,11 +65,6 @@ 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].uniq, @lookup_context.formats |