aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-30 18:29:10 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-07-30 18:29:10 -0700
commit0cdac3e029d0e99fb618d6e900ec66d48938ed63 (patch)
tree1b7f5813ba2fa588165b5da6565bd74dc4415732
parent1468a4b89aa4bca99160bfa03572b2c0ab348db5 (diff)
parent389e9fe9cfab6587a554a48087c400a383a96550 (diff)
downloadrails-0cdac3e029d0e99fb618d6e900ec66d48938ed63.tar.gz
rails-0cdac3e029d0e99fb618d6e900ec66d48938ed63.tar.bz2
rails-0cdac3e029d0e99fb618d6e900ec66d48938ed63.zip
Merge pull request #11668 from neerajdotname/make_test_order_independent_2
Make test order independent
-rw-r--r--activerecord/test/cases/associations/nested_through_associations_test.rb4
-rw-r--r--activerecord/test/cases/test_case.rb5
2 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/nested_through_associations_test.rb b/activerecord/test/cases/associations/nested_through_associations_test.rb
index e75d43bda8..9b1abc3b81 100644
--- a/activerecord/test/cases/associations/nested_through_associations_test.rb
+++ b/activerecord/test/cases/associations/nested_through_associations_test.rb
@@ -186,7 +186,9 @@ class NestedThroughAssociationsTest < ActiveRecord::TestCase
members = assert_queries(4) { Member.includes(:organization_member_details_2).to_a.sort_by(&:id) }
groucho_details, other_details = member_details(:groucho), member_details(:some_other_guy)
- assert_no_queries do
+ # postgresql test if randomly executed then executes "SHOW max_identifier_length". Hence
+ # the need to ignore certain predefined sqls that deal with system calls.
+ assert_no_queries(ignore_none: false) do
assert_equal [groucho_details, other_details], members.first.organization_member_details_2.sort_by(&:id)
end
end
diff --git a/activerecord/test/cases/test_case.rb b/activerecord/test/cases/test_case.rb
index c33e5cdc00..8c6d189b0c 100644
--- a/activerecord/test/cases/test_case.rb
+++ b/activerecord/test/cases/test_case.rb
@@ -45,8 +45,9 @@ module ActiveRecord
x
end
- def assert_no_queries(&block)
- assert_queries(0, :ignore_none => true, &block)
+ def assert_no_queries(options = {}, &block)
+ options.reverse_merge! ignore_none: true
+ assert_queries(0, options, &block)
end
def assert_column(model, column_name, msg=nil)