Merge pull request #23121 from prathamesh-sonpatki/fix-tests

Fix test failure on PostgreSQL by sorting the result before comparison
This commit is contained in:
Yves Senn 2016-01-19 18:47:33 +01:00
commit 1131f47d5d

@ -575,18 +575,19 @@ def test_sti_with_custom_type
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