diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-22 15:51:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-22 15:51:29 -0800 |
commit | 4395d493c5df5476e9e31df3336fc81c8a3e5d3c (patch) | |
tree | 940b7c1ce025788eaeff392c903a2a7ae4f76b49 /actionpack | |
parent | 5c86286dd6f8b58241492004e1fd872e217aca08 (diff) | |
download | rails-4395d493c5df5476e9e31df3336fc81c8a3e5d3c.tar.gz rails-4395d493c5df5476e9e31df3336fc81c8a3e5d3c.tar.bz2 rails-4395d493c5df5476e9e31df3336fc81c8a3e5d3c.zip |
sort lists before comparing them
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 28e8d420d5..43123e68b2 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -14,18 +14,18 @@ class MimeTypeTest < ActiveSupport::TestCase test "parse text with trailing star" do accept = "text/*" - expect = [Mime::JSON, Mime::XML, Mime::ICS, Mime::HTML, Mime::CSS, Mime::CSV, Mime::JS, Mime::YAML, Mime::TEXT] + expect = [Mime::JSON, Mime::XML, Mime::ICS, Mime::HTML, Mime::CSS, Mime::CSV, Mime::JS, Mime::YAML, Mime::TEXT].sort_by(&:to_s) parsed = Mime::Type.parse(accept) assert_equal 9, parsed.size - assert_equal expect, parsed + assert_equal expect, parsed.sort_by(&:to_s) end test "parse application with trailing star" do accept = "application/*" - expect = [Mime::HTML, Mime::JS, Mime::XML, Mime::YAML, Mime::ATOM, Mime::JSON, Mime::RSS, Mime::PDF, Mime::URL_ENCODED_FORM] + expect = [Mime::HTML, Mime::JS, Mime::XML, Mime::YAML, Mime::ATOM, Mime::JSON, Mime::RSS, Mime::PDF, Mime::URL_ENCODED_FORM].sort_by(&:to_s) parsed = Mime::Type.parse(accept) assert_equal 9, parsed.size - assert_equal expect, parsed + assert_equal expect, parsed.sort_by(&:to_s) end test "parse image with trailing star" do |