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 /railties/test/application/initializers | |
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 'railties/test/application/initializers')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 32bce7d372..90927159dd 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -219,7 +219,7 @@ module ApplicationTests end require "#{app_path}/config/environment" ActiveRecord::Base.connection.drop_table("posts") # force drop posts table for test. - assert ActiveRecord::Base.connection.schema_cache.tables("posts") + assert ActiveRecord::Base.connection.schema_cache.data_sources("posts") end test "expire schema cache dump" do @@ -227,10 +227,8 @@ module ApplicationTests `rails generate model post title:string; bin/rails db:migrate db:schema:cache:dump db:rollback` end - silence_warnings { - require "#{app_path}/config/environment" - assert !ActiveRecord::Base.connection.schema_cache.tables("posts") - } + require "#{app_path}/config/environment" + assert !ActiveRecord::Base.connection.schema_cache.data_sources("posts") end test "active record establish_connection uses Rails.env if DATABASE_URL is not set" do |