diff options
author | Yves Senn <yves.senn@gmail.com> | 2016-01-19 18:47:33 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2016-01-19 18:47:33 +0100 |
commit | 1131f47d5dfd0b765c3af62e070521172d2a9835 (patch) | |
tree | e99a0dc851dc525a0f36be1b91bde08b2d4084bb /activerecord/test | |
parent | 3ea4476942d2ba5ddc0d3b2d1f3730455661b06a (diff) | |
parent | e55ba530c1404a55bb5c5ae89ddc09581837c50d (diff) | |
download | rails-1131f47d5dfd0b765c3af62e070521172d2a9835.tar.gz rails-1131f47d5dfd0b765c3af62e070521172d2a9835.tar.bz2 rails-1131f47d5dfd0b765c3af62e070521172d2a9835.zip |
Merge pull request #23121 from prathamesh-sonpatki/fix-tests
Fix test failure on PostgreSQL by sorting the result before comparison
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/inheritance_test.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb index e97275a97b..c870247a4a 100644 --- a/activerecord/test/cases/inheritance_test.rb +++ b/activerecord/test/cases/inheritance_test.rb @@ -575,18 +575,19 @@ class InheritanceAttributeMappingTest < ActiveRecord::TestCase Empire.create! name: 'an Empire' assert_equal [["a Startup", "omg_inheritance_attribute_mapping_test/startup"], - ["an Empire", "omg_inheritance_attribute_mapping_test/empire"]], ActiveRecord::Base.connection.select_rows('SELECT name, type FROM companies') + ["an Empire", "omg_inheritance_attribute_mapping_test/empire"]], ActiveRecord::Base.connection.select_rows('SELECT name, type FROM companies').sort assert_equal [["a Startup", "InheritanceAttributeMappingTest::Startup"], - ["an Empire", "InheritanceAttributeMappingTest::Empire"]], Company.all.map { |a| [a.name, a.type] } + ["an Empire", "InheritanceAttributeMappingTest::Empire"]], Company.all.map { |a| [a.name, a.type] }.sort startup = Startup.first startup.becomes! Empire startup.save! assert_equal [["a Startup", "omg_inheritance_attribute_mapping_test/empire"], - ["an Empire", "omg_inheritance_attribute_mapping_test/empire"]], ActiveRecord::Base.connection.select_rows('SELECT name, type FROM companies') + ["an Empire", "omg_inheritance_attribute_mapping_test/empire"]], ActiveRecord::Base.connection.select_rows('SELECT name, type FROM companies').sort + assert_equal [["a Startup", "InheritanceAttributeMappingTest::Empire"], - ["an Empire", "InheritanceAttributeMappingTest::Empire"]], Company.all.map { |a| [a.name, a.type] } + ["an Empire", "InheritanceAttributeMappingTest::Empire"]], Company.all.map { |a| [a.name, a.type] }.sort end def test_polymorphic_associations_custom_type |