diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-17 15:14:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-17 15:14:22 -0700 |
commit | 9933ab1b28b1c001348e8cb8045084ede72fcf89 (patch) | |
tree | 5252538df9d8a79834bd8e41a50c8db0ad744b5e /activerecord/test/cases/adapters/sqlite3 | |
parent | 822dac1e6dd7baa8ba70ed52a3d8a26f6d31ee7c (diff) | |
download | rails-9933ab1b28b1c001348e8cb8045084ede72fcf89.tar.gz rails-9933ab1b28b1c001348e8cb8045084ede72fcf89.tar.bz2 rails-9933ab1b28b1c001348e8cb8045084ede72fcf89.zip |
experiment
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/explain_test.rb | 26 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb | 5 |
2 files changed, 15 insertions, 16 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/explain_test.rb b/activerecord/test/cases/adapters/sqlite3/explain_test.rb index b227bce680..4bee74000f 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" = 1), 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" = 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 end end end diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index d51d425c3c..83aedfb61a 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -152,7 +152,7 @@ module ActiveRecord def test_quote_binary_column_escapes_it DualEncoding.connection.execute(<<-eosql) - CREATE TABLE dual_encodings ( + CREATE TABLE IF NOT EXISTS dual_encodings ( id integer PRIMARY KEY AUTOINCREMENT, name string, data binary @@ -162,9 +162,8 @@ module ActiveRecord binary = DualEncoding.new :name => 'いただきます!', :data => str binary.save! assert_equal str, binary.data - ensure - DualEncoding.connection.drop_table('dual_encodings') + #DualEncoding.connection.execute('DROP TABLE IF EXISTS dual_encodings') end def test_type_cast_should_not_mutate_encoding |