mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Followup of #27596, test output of "run" method as well
- #27596 Updated "run" and "migrate" method for returning correct value but only added test for "migrate" method. This commit adds a test for "run" as well.
This commit is contained in:
parent
7b13236818
commit
cb28aee503
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue