Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.

Commit

Permalink
Added a test for incremental migration, to try and capture the issue …
Browse files Browse the repository at this point in the history
…described by [#17], but without joy.
  • Loading branch information
lazyatom committed Jun 6, 2008
1 parent f52b0ae commit ec608c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/migration_test.rb
Expand Up @@ -25,6 +25,18 @@ def test_engine_migrations_can_run_up
assert table_exists?('tests')
assert table_exists?('others')
end

def test_engine_migrations_can_upgrade_incrementally
Engines.plugins[:test_migration].migrate(1)
assert table_exists?('tests')
assert !table_exists?('others')
assert_equal 1, Engines::Plugin::Migrator.current_version(Engines.plugins[:test_migration])


Engines.plugins[:test_migration].migrate(2)
assert table_exists?('others')
assert_equal 2, Engines::Plugin::Migrator.current_version(Engines.plugins[:test_migration])
end

def test_generator_creates_plugin_migration_file
Rails::Generator::Scripts::Generate.new.run(['plugin_migration', 'test_migration'], :quiet => true)
Expand Down

0 comments on commit ec608c0

Please sign in to comment.