Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed test_rename_nonexistent_column for PostgreSQL

Also fixed ability to run migration_test.rb alone

[#616 state:resolved]
  • Loading branch information...
commit 8a548e4fa8587f24f214195194c1d6974454b656 1 parent 275c3ab
@tarmo tarmo authored jeremy committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/test/cases/migration_test.rb
View
8 activerecord/test/cases/migration_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.