Skip to content

Commit

Permalink
Tests to specify the behaviour of ActiveRecord::Migrator.get_all_vers…
Browse files Browse the repository at this point in the history
…ions() [#5066 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
thiagopradi authored and josevalim committed Jul 8, 2010
1 parent 4a26a29 commit 8b2330e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -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_"
Expand Down

0 comments on commit 8b2330e

Please sign in to comment.