1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

test code that finds migrations

This commit is contained in:
Aaron Patterson 2012-01-12 15:43:41 -08:00
parent dea59f0150
commit 6e7ba44f83
2 changed files with 5 additions and 6 deletions

View file

@ -186,6 +186,10 @@ module ActiveRecord
connection.change_column_default "test_models", "first_name", nil
assert_nil TestModel.new.first_name
end
def test_remove_column_no_second_parameter_raises_exception
assert_raise(ArgumentError) { connection.remove_column("funny") }
end
end
end
end

View file

@ -91,10 +91,6 @@ class MigrationTest < ActiveRecord::TestCase
Person.connection.drop_table :testings2 rescue nil
end
def test_remove_column_no_second_parameter_raises_exception
assert_raise(ArgumentError) { Person.connection.remove_column("funny") }
end
def test_add_table
assert !Reminder.table_exists?
@ -315,8 +311,7 @@ class MigrationTest < ActiveRecord::TestCase
end
def test_finds_migrations
list = ActiveRecord::Migrator.migrations(MIGRATIONS_ROOT + "/valid")
migrations = ActiveRecord::Migrator.new(:up, list).migrations
migrations = ActiveRecord::Migrator.migrations(MIGRATIONS_ROOT + "/valid")
[[1, 'ValidPeopleHaveLastNames'], [2, 'WeNeedReminders'], [3, 'InnocentJointable']].each_with_index do |pair, i|
assert_equal migrations[i].version, pair.first