aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/persistence_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-22 11:08:04 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-22 22:41:10 -0300
commitb332891b2ab4188e9d39737f4d214812afa3ce2c (patch)
tree72974490c032f9a753f3fc41d335a049c8abbc05 /activerecord/test/cases/persistence_test.rb
parentb714140f4df50d102e70b0151bbb3a09e470d61a (diff)
downloadrails-b332891b2ab4188e9d39737f4d214812afa3ce2c.tar.gz
rails-b332891b2ab4188e9d39737f4d214812afa3ce2c.tar.bz2
rails-b332891b2ab4188e9d39737f4d214812afa3ce2c.zip
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.
Diffstat (limited to 'activerecord/test/cases/persistence_test.rb')
-rw-r--r--activerecord/test/cases/persistence_test.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb
index adfd8e83a1..e4b8caae52 100644
--- a/activerecord/test/cases/persistence_test.rb
+++ b/activerecord/test/cases/persistence_test.rb
@@ -17,15 +17,16 @@ require 'rexml/document'
require 'active_support/core_ext/exception'
class PersistencesTest < ActiveRecord::TestCase
+ fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics,
+ 'warehouse-things', :authors, :categorizations, :categories, :posts, :minivans
- fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors, :categorizations, :categories, :posts, :minivans
-
- # Oracle UPDATE does not support ORDER BY
- unless current_adapter?(:OracleAdapter)
+ # Skip databases that don't support UPDATE + ORDER BY
+ unless current_adapter?(:OracleAdapter, :PostgreSQLAdapter)
def test_update_all_ignores_order_without_limit_from_association
author = authors(:david)
assert_nothing_raised do
- assert_equal author.posts_with_comments_and_categories.length, author.posts_with_comments_and_categories.update_all([ "body = ?", "bulk update!" ])
+ assert_equal author.posts_with_comments_and_categories.length,
+ author.posts_with_comments_and_categories.update_all([ "body = ?", "bulk update!" ])
end
end