mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
test for structure:dump without schema information table. refs eafec46
This is a test case for the fix provided in eafec4694c
This commit is contained in:
parent
f522aebb6a
commit
582cbff616
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue