Skip to content

Commit

Permalink
Followup of rails#27596, test output of "run" method as well
Browse files Browse the repository at this point in the history
- rails#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.
  • Loading branch information
prathamesh-sonpatki authored and schneems committed Jan 9, 2017
1 parent ccdd583 commit 3156269
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion activerecord/test/cases/migrator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_migrator_going_down_due_to_version_target
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")
Expand All @@ -304,6 +304,13 @@ def test_migrator_output
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)

Expand Down

0 comments on commit 3156269

Please sign in to comment.