Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit dbd84b4f723a76aa945cf6fee2f0c65acf20f88f 1 parent 482fa29
@senny senny authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 railties/test/application/rake/dbs_test.rb
View
12 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;
Please sign in to comment.
Something went wrong with that request. Please try again.