aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/inheritance_test.rb
diff options
context:
space:
mode:
authorPrathamesh Sonpatki <csonpatki@gmail.com>2016-01-19 22:45:25 +0530
committerPrathamesh Sonpatki <csonpatki@gmail.com>2016-01-19 22:45:25 +0530
commite55ba530c1404a55bb5c5ae89ddc09581837c50d (patch)
treee99a0dc851dc525a0f36be1b91bde08b2d4084bb /activerecord/test/cases/inheritance_test.rb
parent3ea4476942d2ba5ddc0d3b2d1f3730455661b06a (diff)
downloadrails-e55ba530c1404a55bb5c5ae89ddc09581837c50d.tar.gz
rails-e55ba530c1404a55bb5c5ae89ddc09581837c50d.tar.bz2
rails-e55ba530c1404a55bb5c5ae89ddc09581837c50d.zip
Fix test failure on PostgreSQL by sorting the result before comparison
Diffstat (limited to 'activerecord/test/cases/inheritance_test.rb')
-rw-r--r--activerecord/test/cases/inheritance_test.rb9
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