提交 6e7ba44f 编写于 作者: A Aaron Patterson

test code that finds migrations

上级 dea59f01
......@@ -186,6 +186,10 @@ def test_change_column_default_to_null
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
......@@ -91,10 +91,6 @@ def drop_table; raise "no"; end
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 @@ def migrate(x); raise 'Something broke'; end
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册