aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorViktar Basharymau <viktar.basharymau@thehamon.com>2014-06-27 18:28:12 +0300
committerViktar Basharymau <viktar.basharymau@thehamon.com>2014-06-27 18:28:12 +0300
commit0813607c7004ab06d35ae75ba205b97cf37122a2 (patch)
tree96e63fd6577551f8f7d24ca4c923d26a874f81cb /railties/test
parente75bdcb4d8698947ed228eeacd2d3f23eaad0f6b (diff)
downloadrails-0813607c7004ab06d35ae75ba205b97cf37122a2.tar.gz
rails-0813607c7004ab06d35ae75ba205b97cf37122a2.tar.bz2
rails-0813607c7004ab06d35ae75ba205b97cf37122a2.zip
Add a test for db:migrate:status to check missing file scenario
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/rake/migrations_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/application/rake/migrations_test.rb b/railties/test/application/rake/migrations_test.rb
index a6900a57c4..a3819b93b2 100644
--- a/railties/test/application/rake/migrations_test.rb
+++ b/railties/test/application/rake/migrations_test.rb
@@ -184,6 +184,21 @@ module ApplicationTests
assert_match(/create_table "books"/, structure_dump)
end
end
+
+ test 'test migration status migrated file is deleted' do
+ Dir.chdir(app_path) do
+ `rails generate model user username:string password:string;
+ rails generate migration add_email_to_users email:string;
+ rake db:migrate
+ rm db/migrate/*email*.rb`
+
+ output = `rake db:migrate:status`
+ File.write('test.txt', output)
+
+ assert_match(/up\s+\d{14}\s+Create users/, output)
+ assert_match(/up\s+\d{14}\s+\** NO FILE \**/, output)
+ end
+ end
end
end
end