diff options
author | ganesh <ganesh@ganesh-Studio-1558.(none)> | 2012-06-11 22:57:11 +0530 |
---|---|---|
committer | ganesh <ganesh@ganesh-Studio-1558.(none)> | 2012-06-11 22:57:11 +0530 |
commit | c74662a27f642700d3e59482bef6e6bc7e84b5ba (patch) | |
tree | 0f0a231a92960cf62dab69d045e2146130c75b5f /actionpack/test/dispatch | |
parent | 04a7426a2e2567a0e2101c98711393fdfc40160e (diff) | |
download | rails-c74662a27f642700d3e59482bef6e6bc7e84b5ba.tar.gz rails-c74662a27f642700d3e59482bef6e6bc7e84b5ba.tar.bz2 rails-c74662a27f642700d3e59482bef6e6bc7e84b5ba.zip |
both string and sumbol will be interpolated as string no need to convert to_s
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index e3f9faaa64..9d77c3acc5 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -148,11 +148,11 @@ class MimeTypeTest < ActiveSupport::TestCase types = Mime::SET.symbols.uniq - [:all, :iphone] # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE - types.delete_if { |type| !Mime.const_defined?(type.to_s.upcase) } + types.delete_if { |type| !Mime.const_defined?(type.upcase) } types.each do |type| - mime = Mime.const_get(type.to_s.upcase) + mime = Mime.const_get(type.upcase) assert mime.respond_to?("#{type}?"), "#{mime.inspect} does not respond to #{type}?" assert mime.send("#{type}?"), "#{mime.inspect} is not #{type}?" invalid_types = types - [type] @@ -170,10 +170,10 @@ class MimeTypeTest < ActiveSupport::TestCase all_types = Mime::SET.symbols all_types.uniq! # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE - all_types.delete_if { |type| !Mime.const_defined?(type.to_s.upcase) } + all_types.delete_if { |type| !Mime.const_defined?(type.upcase) } verified, unverified = all_types.partition { |type| Mime::Type.browser_generated_types.include? type } - assert verified.each { |type| assert Mime.const_get(type.to_s.upcase).verify_request?, "Verifiable Mime Type is not verified: #{type.inspect}" } - assert unverified.each { |type| assert !Mime.const_get(type.to_s.upcase).verify_request?, "Nonverifiable Mime Type is verified: #{type.inspect}" } + assert verified.each { |type| assert Mime.const_get(type.upcase).verify_request?, "Verifiable Mime Type is not verified: #{type.inspect}" } + assert unverified.each { |type| assert !Mime.const_get(type.upcase).verify_request?, "Nonverifiable Mime Type is verified: #{type.inspect}" } end test "references gives preference to symbols before strings" do |