aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/mime_type_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-21 14:10:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-21 14:10:17 -0700
commitf8ba48c150fb70ed0bcb8ff74cf2aabc81173082 (patch)
treeada3ef19522f883e7de3a8a094456fb2c2feb134 /actionpack/test/dispatch/mime_type_test.rb
parent7cdb2ec9636288dce25836c3ec0f261537a6425f (diff)
downloadrails-f8ba48c150fb70ed0bcb8ff74cf2aabc81173082.tar.gz
rails-f8ba48c150fb70ed0bcb8ff74cf2aabc81173082.tar.bz2
rails-f8ba48c150fb70ed0bcb8ff74cf2aabc81173082.zip
introduce an `All` mime type
This class gives us the `all?` predicate method that returns true without hitting method missing
Diffstat (limited to 'actionpack/test/dispatch/mime_type_test.rb')
-rw-r--r--actionpack/test/dispatch/mime_type_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb
index 520864b7d9..791c6ff625 100644
--- a/actionpack/test/dispatch/mime_type_test.rb
+++ b/actionpack/test/dispatch/mime_type_test.rb
@@ -163,10 +163,12 @@ class MimeTypeTest < ActiveSupport::TestCase
types.each do |type|
mime = Mime::Type[type.upcase]
assert mime.respond_to?("#{type}?"), "#{mime.inspect} does not respond to #{type}?"
- assert mime.send("#{type}?"), "#{mime.inspect} is not #{type}?"
+ assert_equal type, mime.symbol, "#{mime.inspect} is not #{type}?"
invalid_types = types - [type]
invalid_types.delete(:html) if Mime::Type.html_types.include?(type)
- invalid_types.each { |other_type| assert !mime.send("#{other_type}?"), "#{mime.inspect} is #{other_type}?" }
+ invalid_types.each { |other_type|
+ assert_not_equal mime.symbol, other_type, "#{mime.inspect} is #{other_type}?"
+ }
end
end