diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-03-20 18:40:51 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-03-20 18:40:51 +0100 |
commit | 582cbff616a927df097353ea8f96c3c1b88f4847 (patch) | |
tree | 231b081a9ded99245b6d209b560965204644f615 /railties/test/application | |
parent | f522aebb6a844a278f1230e8e1f201e96f95203b (diff) | |
download | rails-582cbff616a927df097353ea8f96c3c1b88f4847.tar.gz rails-582cbff616a927df097353ea8f96c3c1b88f4847.tar.bz2 rails-582cbff616a927df097353ea8f96c3c1b88f4847.zip |
test for structure:dump without schema information table. refs eafec46
This is a test case for the fix provided in eafec4694c5b37eff9d83b1188b8e331fa6027fa
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 9a5c5ed223..b2c52a092f 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -134,6 +134,18 @@ module ApplicationTests db_structure_dump_and_load database_url_db_name end + test 'db:structure:dump does not dump schema information when no migrations are used' do + Dir.chdir(app_path) do + # create table without migrations + `bundle exec rails runner 'ActiveRecord::Base.connection.create_table(:posts) {|t| t.string :title }'` + + stderr_output = capture(:stderr) { `bundle exec rake db:structure:dump` } + assert_empty stderr_output + structure_dump = File.read("db/structure.sql") + assert_match(/CREATE TABLE \"posts\"/, structure_dump) + end + end + def db_test_load_structure Dir.chdir(app_path) do `rails generate model book title:string; |