aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-03-05 23:38:59 -0800
committerJohn Hawthorn <john@hawthorn.email>2019-03-14 11:33:48 -0700
commitb5e8942c95078945ff09a83b2fc03a0ae7e35953 (patch)
treedc35e0dbd8f1b69b6d4770c94ca3454d2ad19f6f /actionview/test/template
parent43fc7b476b483a89dacf9964ccf288f6bc6e1595 (diff)
downloadrails-b5e8942c95078945ff09a83b2fc03a0ae7e35953.tar.gz
rails-b5e8942c95078945ff09a83b2fc03a0ae7e35953.tar.bz2
rails-b5e8942c95078945ff09a83b2fc03a0ae7e35953.zip
Raise exception when building invalid mime type
This allows mime types in the form text/html, text/*, or */* This required a few minor test/code changes where previously nil was used as a mime string.
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/html_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionview/test/template/html_test.rb b/actionview/test/template/html_test.rb
index c5fc8f906c..17f21cbbc5 100644
--- a/actionview/test/template/html_test.rb
+++ b/actionview/test/template/html_test.rb
@@ -8,9 +8,9 @@ class HTMLTest < ActiveSupport::TestCase
end
test "formats returns string for recognized MIME type when MIME does not have symbol" do
- foo = Mime::Type.lookup("foo")
+ foo = Mime::Type.lookup("text/foo")
assert_nil foo.to_sym
- assert_equal "foo", ActionView::Template::HTML.new("", foo).format
+ assert_equal "text/foo", ActionView::Template::HTML.new("", foo).format
end
test "formats returns string for unknown MIME type" do