From b332891b2ab4188e9d39737f4d214812afa3ce2c Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 22 Mar 2012 11:08:04 -0300 Subject: Add order to tests that rely on db ordering, to fix failing tests on pg Also skip persistente tests related to UPDATE + ORDER BY for postgresql PostgreSQL does not support updates with order by, and these tests are failing randomly depending on the fixture loading order now. --- activerecord/test/cases/json_serialization_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases/json_serialization_test.rb') diff --git a/activerecord/test/cases/json_serialization_test.rb b/activerecord/test/cases/json_serialization_test.rb index d9e350abc0..7240616085 100644 --- a/activerecord/test/cases/json_serialization_test.rb +++ b/activerecord/test/cases/json_serialization_test.rb @@ -211,7 +211,7 @@ class DatabaseConnectedJsonEncodingTest < ActiveRecord::TestCase ['"name":"David"', '"posts":[', '{"id":1}', '{"id":2}', '{"id":4}', '{"id":5}', '{"id":6}', '"name":"Mary"', '"posts":[', '{"id":7}', '{"id":9}'].each do |fragment| assert json.include?(fragment), json - end + end end def test_should_allow_options_for_hash_of_authors @@ -223,7 +223,7 @@ class DatabaseConnectedJsonEncodingTest < ActiveRecord::TestCase end def test_should_be_able_to_encode_relation - authors_relation = Author.where(:id => [@david.id, @mary.id]) + authors_relation = Author.where(:id => [@david.id, @mary.id]).order(:id) json = ActiveSupport::JSON.encode authors_relation, :only => :name assert_equal '[{"author":{"name":"David"}},{"author":{"name":"Mary"}}]', json -- cgit v1.2.3