Skip to content

Commit

Permalink
stop ddl modifications for another test
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 16, 2012
1 parent b731593 commit 86a73cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 0 additions & 12 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -233,18 +233,6 @@ def migrate(x); raise 'Something broke'; end
refute Person.column_methods_hash.include?(:last_name)
end

def test_only_loads_pending_migrations
# migrate up to 1
ActiveRecord::SchemaMigration.create!(:version => '1')

proxies = ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid", nil)

names = proxies.map(&:name)
assert !names.include?('ValidPeopleHaveLastNames')
assert names.include?('WeNeedReminders')
assert names.include?('InnocentJointable')
end

def test_get_all_versions
ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
Expand Down
10 changes: 10 additions & 0 deletions activerecord/test/cases/migrator_test.rb
Expand Up @@ -318,6 +318,16 @@ def test_migrator_forward
assert_equal(3, ActiveRecord::Migrator.current_version)
end

def test_only_loads_pending_migrations
# migrate up to 1
ActiveRecord::SchemaMigration.create!(:version => '1')

calls, migrator = migrator_class(3)
migrator.migrate("valid", nil)

assert_equal [[:up, 2], [:up, 3]], calls
end

private
def m(name, version, &block)
x = Sensor.new name, version
Expand Down

0 comments on commit 86a73cd

Please sign in to comment.