aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-03-27 17:07:56 -0400
committerGitHub <noreply@github.com>2017-03-27 17:07:56 -0400
commit8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b (patch)
treea865ce4d154c06dc845e2ebe38045bba511bd4ee /railties
parent13683546b8fe7be34b3b094d10ab166561c1ecb4 (diff)
parent14739b5e27987e1eee080579fa0c80eea07347b8 (diff)
downloadrails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.tar.gz
rails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.tar.bz2
rails-8c658a0ecc7f2b5fc015d424baf9edf6f3eb2b0b.zip
Merge pull request #28485 from quantumlicht/fix_migrate_with_empty_version
fix migrate with empty version
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/rake/migrations_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/application/rake/migrations_test.rb b/railties/test/application/rake/migrations_test.rb
index 76cb302c62..00f6620188 100644
--- a/railties/test/application/rake/migrations_test.rb
+++ b/railties/test/application/rake/migrations_test.rb
@@ -37,6 +37,22 @@ module ApplicationTests
end
end
+ test "migration with empty version" do
+ Dir.chdir(app_path) do
+ output = `bin/rails db:migrate VERSION= 2>&1`
+ assert_match(/Empty VERSION provided/, output)
+
+ output = `bin/rails db:migrate:redo VERSION= 2>&1`
+ assert_match(/Empty VERSION provided/, output)
+
+ output = `bin/rails db:migrate:up VERSION= 2>&1`
+ assert_match(/VERSION is required/, output)
+
+ output = `bin/rails db:migrate:down VERSION= 2>&1`
+ assert_match(/VERSION is required - To go down one migration, use db:rollback/, output)
+ end
+ end
+
test "model and migration generator with change syntax" do
Dir.chdir(app_path) do
`bin/rails generate model user username:string password:string;