aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorkennyj <kennyj@gmail.com>2012-03-01 01:01:12 +0900
committerkennyj <kennyj@gmail.com>2012-03-01 01:01:12 +0900
commit0150a212c068c6e4a580218913f44f278e086bd3 (patch)
tree10818848e9a5c3682f4f8c243d03536601e3671d /railties
parent5ca4fc95818047108e69e22d200e7a4a22969477 (diff)
downloadrails-0150a212c068c6e4a580218913f44f278e086bd3.tar.gz
rails-0150a212c068c6e4a580218913f44f278e086bd3.tar.bz2
rails-0150a212c068c6e4a580218913f44f278e086bd3.zip
Add db:schema:cache:dump and db:schema:cache:clear tasks.
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/rake_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index ff12b3e9fc..9515e40b6e 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -138,5 +138,24 @@ module ApplicationTests
end
assert File.exists?(File.join(app_path, 'db', 'my_structure.sql'))
end
+
+ def test_rake_dump_schema_cache
+ Dir.chdir(app_path) do
+ `rails generate model post title:string`
+ `rails generate model product name:string`
+ `bundle exec rake db:migrate`
+ `bundle exec rake db:schema:cache:dump`
+ end
+ assert File.exists?(File.join(app_path, 'db', 'schema_cache.dump'))
+ end
+
+ def test_rake_clear_schema_cache
+ Dir.chdir(app_path) do
+ `bundle exec rake db:schema:cache:dump`
+ `bundle exec rake db:schema:cache:clear`
+ end
+ assert !File.exists?(File.join(app_path, 'db', 'schema_cache.dump'))
+ end
+
end
end