From 582cbff616a927df097353ea8f96c3c1b88f4847 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 20 Mar 2014 18:40:51 +0100 Subject: test for structure:dump without schema information table. refs eafec46 This is a test case for the fix provided in eafec4694c5b37eff9d83b1188b8e331fa6027fa --- railties/test/application/rake/dbs_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'railties') 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; -- cgit v1.2.3