Permalink
Browse files

Tests to specify the behaviour of ActiveRecord::Migrator.get_all_vers…

…ions() [#5066 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 4a26a29 commit 8b2330ebc3dd2f65a605260366d2445ee7a3009b @thiagopradi thiagopradi committed with josevalim Jul 8, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 activerecord/test/cases/migration_test.rb
@@ -1358,6 +1358,20 @@ def test_migrator_forward
ActiveRecord::Migrator.forward(MIGRATIONS_ROOT + "/valid")
assert_equal(3, ActiveRecord::Migrator.current_version)
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
ActiveRecord::Base.table_name_prefix = "prefix_"

0 comments on commit 8b2330e

Please sign in to comment.