From 9c04b55e52b50ced257dc215071605aa6291fc30 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 17 Jan 2014 11:14:50 -0800 Subject: fixing explain tests for sqlite3 --- .../test/cases/adapters/sqlite3/explain_test.rb | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'activerecord/test/cases/adapters/sqlite3/explain_test.rb') diff --git a/activerecord/test/cases/adapters/sqlite3/explain_test.rb b/activerecord/test/cases/adapters/sqlite3/explain_test.rb index 4bee74000f..68169cc7fc 100644 --- a/activerecord/test/cases/adapters/sqlite3/explain_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/explain_test.rb @@ -5,21 +5,21 @@ module ActiveRecord module ConnectionAdapters class SQLite3Adapter class ExplainTest < ActiveRecord::TestCase - #fixtures :developers + fixtures :developers - #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(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) - #end + def test_explain_for_one_query + explain = Developer.where(:id => 1).explain + assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = ?), explain + assert_match(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) + end - #def test_explain_with_eager_loading - # explain = Developer.where(:id => 1).includes(:audit_logs).explain - # assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = 1), explain - # assert_match(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) - # assert_match %(EXPLAIN for: SELECT "audit_logs".* FROM "audit_logs" WHERE "audit_logs"."developer_id" IN (1)), explain - # assert_match(/(SCAN )?TABLE audit_logs/, explain) - #end + def test_explain_with_eager_loading + explain = Developer.where(:id => 1).includes(:audit_logs).explain + assert_match %(EXPLAIN for: SELECT "developers".* FROM "developers" WHERE "developers"."id" = ?), explain + assert_match(/(SEARCH )?TABLE developers USING (INTEGER )?PRIMARY KEY/, explain) + assert_match %(EXPLAIN for: SELECT "audit_logs".* FROM "audit_logs" WHERE "audit_logs"."developer_id" IN (1)), explain + assert_match(/(SCAN )?TABLE audit_logs/, explain) + end end end end -- cgit v1.2.3