Permalink
Browse files

test for structure:dump without schema information table. refs eafec46

This is a test case for the fix provided in eafec46
  • Loading branch information...
1 parent 482fa29 commit dbd84b4f723a76aa945cf6fee2f0c65acf20f88f @senny senny committed Mar 20, 2014
Showing with 12 additions and 0 deletions.
  1. +12 −0 railties/test/application/rake/dbs_test.rb
@@ -149,6 +149,18 @@ def db_structure_dump_and_load
db_structure_dump_and_load
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;

0 comments on commit dbd84b4

Please sign in to comment.