Skip to content

Commit

Permalink
Don't test PostgreSQL implementation details
Browse files Browse the repository at this point in the history
Asserting that the message contains "QUERY PLAN" is enough for the adapter's test.
The plan may vary according to number of tuples etc. but that's out of our concern.
  • Loading branch information
amatsuda committed Aug 29, 2014
1 parent 42d5e78 commit 7447e0b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions activerecord/test/cases/adapters/postgresql/explain_test.rb
Expand Up @@ -11,16 +11,13 @@ def test_explain_for_one_query
explain = Developer.where(:id => 1).explain
assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = $1), explain
assert_match %(QUERY PLAN), explain
assert_match %(Index Scan using developers_pkey on developers), explain
end

def test_explain_with_eager_loading
explain = Developer.where(:id => 1).includes(:audit_logs).explain
assert_match %(QUERY PLAN), explain
assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = $1), explain
assert_match %(Index Scan using developers_pkey on developers), explain
assert_match %(EXPLAIN for: SELECT "audit_logs".* FROM "audit_logs" WHERE "audit_logs"."developer_id" IN (1)), explain
assert_match %(Seq Scan on audit_logs), explain
end
end
end
Expand Down

0 comments on commit 7447e0b

Please sign in to comment.