From 8b2330ebc3dd2f65a605260366d2445ee7a3009b Mon Sep 17 00:00:00 2001 From: Thiago Pradi Date: Thu, 8 Jul 2010 03:26:37 -0300 Subject: Tests to specify the behaviour of ActiveRecord::Migrator.get_all_versions() [#5066 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/test/cases/migration_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'activerecord/test/cases/migration_test.rb') diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 4ce9bdb46d..2c3fc46831 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1358,6 +1358,20 @@ if ActiveRecord::Base.connection.supports_migrations? 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_" -- cgit v1.2.3