diff options
author | Richard Schneeman <richard.schneeman+no-recruiters@gmail.com> | 2017-01-06 20:24:11 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-06 20:24:11 -0600 |
commit | 7b13236818ffb26e94d72885e75966efffd71659 (patch) | |
tree | b76ce1819cf2bedfdd3e10f73d0a23837d708f23 /activerecord/test | |
parent | 98c6e4e56ca2a8f9f987e12815f7cdf66e5f1485 (diff) | |
parent | 93ee268ef40b052497daf22f124fc1535acabd64 (diff) | |
download | rails-7b13236818ffb26e94d72885e75966efffd71659.tar.gz rails-7b13236818ffb26e94d72885e75966efffd71659.tar.bz2 rails-7b13236818ffb26e94d72885e75966efffd71659.zip |
Merge pull request #27596 from schneems/schneems/migrator-result
Preserve `up` and `down` return type
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migrator_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index bb9835394b..cb44c443c7 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -290,6 +290,20 @@ class MigratorTest < ActiveRecord::TestCase assert_equal [[:up, 1], [:up, 2], [:up, 3]], calls end + def test_migrator_output + _, migrator = migrator_class(3) + + result = migrator.migrate("valid") + assert_equal(3, result.count) + + # Nothing migrated from duplicate run + result = migrator.migrate("valid") + assert_equal(0, result.count) + + result = migrator.rollback("valid") + assert_equal(1, result.count) + end + def test_migrator_rollback _, migrator = migrator_class(3) |