提交 8f72bc92 编写于 作者: T Tarmo Tänav 提交者: Jeremy Kemper

Fixed test_rename_nonexistent_column for PostgreSQL

Also fixed ability to run migration_test.rb alone

[#616 state:resolved]
上级 c760dbfd
......@@ -3,6 +3,7 @@
require 'models/person'
require 'models/topic'
require 'models/developer'
require MIGRATIONS_ROOT + "/valid/1_people_have_last_names"
require MIGRATIONS_ROOT + "/valid/2_we_need_reminders"
......@@ -511,7 +512,12 @@ def test_rename_nonexistent_column
ActiveRecord::Base.connection.create_table(:hats) do |table|
table.column :hat_name, :string, :default => nil
end
assert_raises(ActiveRecord::ActiveRecordError) do
exception = if current_adapter?(:PostgreSQLAdapter)
ActiveRecord::StatementInvalid
else
ActiveRecord::ActiveRecordError
end
assert_raises(exception) do
Person.connection.rename_column "hats", "nonexistent", "should_fail"
end
ensure
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册