diff options
author | kennyj <kennyj@gmail.com> | 2012-03-01 01:13:14 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-03-01 01:13:14 +0900 |
commit | 0da12df2608969330bd47c543866f79ff8ca9edd (patch) | |
tree | 7299cbc132879c3af3490d461b1d6c405abed474 /railties/test/application/initializers | |
parent | 0150a212c068c6e4a580218913f44f278e086bd3 (diff) | |
download | rails-0da12df2608969330bd47c543866f79ff8ca9edd.tar.gz rails-0da12df2608969330bd47c543866f79ff8ca9edd.tar.bz2 rails-0da12df2608969330bd47c543866f79ff8ca9edd.zip |
Load db/schema_cache.dump duaring boot time.
Diffstat (limited to 'railties/test/application/initializers')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 8812685620..d8012eed64 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -193,5 +193,17 @@ module ApplicationTests require "#{app_path}/config/environment" assert_nil defined?(ActiveRecord::Base) end + + test "use schema cache dump" do + Dir.chdir(app_path) do + `rails generate model post title:string` + `bundle exec rake db:migrate` + `bundle exec rake db:schema:cache:dump` + 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"] + end + end end |