1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Tests to specify the behaviour of ActiveRecord::Migrator.get_all_versions() [#5066 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Thiago Pradi 2010-07-08 03:26:37 -03:00 committed by José Valim
parent 4a26a292a0
commit 8b2330ebc3

View file

@ -1358,6 +1358,20 @@ if ActiveRecord::Base.connection.supports_migrations?
ActiveRecord::Migrator.forward(MIGRATIONS_ROOT + "/valid") ActiveRecord::Migrator.forward(MIGRATIONS_ROOT + "/valid")
assert_equal(3, ActiveRecord::Migrator.current_version) assert_equal(3, ActiveRecord::Migrator.current_version)
end end
def test_get_all_versions
ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
assert_equal([1,2], ActiveRecord::Migrator.get_all_versions)
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
assert_equal([1], ActiveRecord::Migrator.get_all_versions)
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
assert_equal([], ActiveRecord::Migrator.get_all_versions)
end
def test_schema_migrations_table_name def test_schema_migrations_table_name
ActiveRecord::Base.table_name_prefix = "prefix_" ActiveRecord::Base.table_name_prefix = "prefix_"