diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-29 03:33:15 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-12-29 17:53:04 -0500 |
commit | 5973a984c369a63720c2ac18b71012b8347479a8 (patch) | |
tree | 47acd2bf99aa801da5d59bff6e373c65fd608152 /activerecord/test/cases/adapters/sqlite3 | |
parent | d5be101dd02214468a27b6839ffe338cfe8ef5f3 (diff) | |
download | rails-5973a984c369a63720c2ac18b71012b8347479a8.tar.gz rails-5973a984c369a63720c2ac18b71012b8347479a8.tar.bz2 rails-5973a984c369a63720c2ac18b71012b8347479a8.zip |
`#tables` and `#table_exists?` and returns only tables and not views
Diffstat (limited to 'activerecord/test/cases/adapters/sqlite3')
-rw-r--r-- | activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb index 39bd54cbd7..a6109348cc 100644 --- a/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb +++ b/activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb @@ -267,9 +267,9 @@ module ActiveRecord def test_tables with_example_table do - ActiveSupport::Deprecation.silence { assert_equal %w{ ex }, @conn.tables } + assert_equal %w{ ex }, @conn.tables with_example_table "id integer PRIMARY KEY AUTOINCREMENT, number integer", "people" do - ActiveSupport::Deprecation.silence { assert_equal %w{ ex people }.sort, @conn.tables.sort } + assert_equal %w{ ex people }.sort, @conn.tables.sort end end end @@ -277,7 +277,7 @@ module ActiveRecord def test_tables_logs_name sql = <<-SQL SELECT name FROM sqlite_master - WHERE type IN ('table','view') AND name <> 'sqlite_sequence' + WHERE type = 'table' AND name <> 'sqlite_sequence' SQL assert_logged [[sql.squish, "SCHEMA", []]] do @conn.tables @@ -296,12 +296,10 @@ module ActiveRecord with_example_table do sql = <<-SQL SELECT name FROM sqlite_master - WHERE type IN ('table','view') AND name <> 'sqlite_sequence' AND name = 'ex' + WHERE type = 'table' AND name <> 'sqlite_sequence' AND name = 'ex' SQL assert_logged [[sql.squish, "SCHEMA", []]] do - ActiveSupport::Deprecation.silence do - assert @conn.table_exists?("ex") - end + assert @conn.table_exists?("ex") end end end |