aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2017-01-08 00:35:22 -0300
committerGitHub <noreply@github.com>2017-01-08 00:35:22 -0300
commit533da1d5a9c78a9b8511ad1ea70958c0908a2191 (patch)
treec0114295fd536078b1acb49b88313a83f1c75483 /activerecord/test
parent11a50f48113df300f3225e4963aeb1030ec6ad35 (diff)
parentcb28aee503d0acea027100addbb133552ff192a7 (diff)
downloadrails-533da1d5a9c78a9b8511ad1ea70958c0908a2191.tar.gz
rails-533da1d5a9c78a9b8511ad1ea70958c0908a2191.tar.bz2
rails-533da1d5a9c78a9b8511ad1ea70958c0908a2191.zip
Merge pull request #27602 from prathamesh-sonpatki/followup-27596
Followup of #27596, test output of "run" method as well
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/migrator_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb
index cb44c443c7..224e8d1854 100644
--- a/activerecord/test/cases/migrator_test.rb
+++ b/activerecord/test/cases/migrator_test.rb
@@ -290,7 +290,7 @@ class MigratorTest < ActiveRecord::TestCase
assert_equal [[:up, 1], [:up, 2], [:up, 3]], calls
end
- def test_migrator_output
+ def test_migrator_output_when_running_multiple_migrations
_, migrator = migrator_class(3)
result = migrator.migrate("valid")
@@ -304,6 +304,13 @@ class MigratorTest < ActiveRecord::TestCase
assert_equal(1, result.count)
end
+ def test_migrator_output_when_running_single_migration
+ _, migrator = migrator_class(1)
+ result = migrator.run(:up, "valid", 1)
+
+ assert_equal(1, result.version)
+ end
+
def test_migrator_rollback
_, migrator = migrator_class(3)