diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 10:30:52 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-13 14:33:58 -0800 |
commit | ff5c385620c74f265e31e284e199fe29764622c6 (patch) | |
tree | 2dad6dea091ed65b7da6b27d0d9c67fb4ef17dc9 /activerecord | |
parent | 85e5fac959cc8345abf8690d1ba4ea11f6bc5732 (diff) | |
download | rails-ff5c385620c74f265e31e284e199fe29764622c6.tar.gz rails-ff5c385620c74f265e31e284e199fe29764622c6.tar.bz2 rails-ff5c385620c74f265e31e284e199fe29764622c6.zip |
move another migrator test, use schema migration model
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 10 | ||||
-rw-r--r-- | activerecord/test/cases/migrator_test.rb | 9 |
2 files changed, 9 insertions, 10 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 837287f2c2..dfe55cfb16 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -319,16 +319,6 @@ class MigrationTest < ActiveRecord::TestCase assert_match(/20100201010101.*20100301010101/m, schema_info) end - def test_finds_pending_migrations - ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2", 1) - migration_list = ActiveRecord::Migrator.migrations(MIGRATIONS_ROOT + "/interleaved/pass_2") - migrations = ActiveRecord::Migrator.new(:up, migration_list).pending_migrations - - assert_equal 1, migrations.size - assert_equal migrations[0].version, 3 - assert_equal migrations[0].name, 'InterleavedInnocentJointable' - end - def test_only_loads_pending_migrations # migrate up to 1 ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/valid", 1) diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index 45d070d86e..d938eca575 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -71,5 +71,14 @@ module ActiveRecord } assert migration_proxy, 'should find pending migration' end + + def test_finds_pending_migrations + ActiveRecord::SchemaMigration.create!(:version => '1') + migration_list = [ Migration.new('foo', 1), Migration.new('bar', 3) ] + migrations = ActiveRecord::Migrator.new(:up, migration_list).pending_migrations + + assert_equal 1, migrations.size + assert_equal migration_list.last, migrations.first + end end end |