Skip to content
Browse files

Merge pull request #11668 from neerajdotname/make_test_order_independ…

…ent_2

Make test order independent
  • Loading branch information...
2 parents 1468a4b + 389e9fe commit 0cdac3e029d0e99fb618d6e900ec66d48938ed63 @rafaelfranca rafaelfranca committed Jul 30, 2013
View
4 activerecord/test/cases/associations/nested_through_associations_test.rb
@@ -186,7 +186,9 @@ def test_has_many_through_has_one_through_with_has_many_source_reflection_preloa
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
View
5 activerecord/test/cases/test_case.rb
@@ -45,8 +45,9 @@ def assert_queries(num = 1, options = {})
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)

0 comments on commit 0cdac3e

Please sign in to comment.
Something went wrong with that request. Please try again.