aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/initializers
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 03:33:15 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-12-29 17:53:04 -0500
commit5973a984c369a63720c2ac18b71012b8347479a8 (patch)
tree47acd2bf99aa801da5d59bff6e373c65fd608152 /railties/test/application/initializers
parentd5be101dd02214468a27b6839ffe338cfe8ef5f3 (diff)
downloadrails-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.rb8
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