diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-07-14 09:40:05 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-14 12:22:27 -0700 |
commit | 8f72bc92e20b1242272714f253e23b256761ec1a (patch) | |
tree | e4bef55408ddddd8e0f7435b9011c5881ce8de5a /activerecord/test/cases | |
parent | c760dbfd3117562c6f27170a213f586e3ba2b794 (diff) | |
download | rails-8f72bc92e20b1242272714f253e23b256761ec1a.tar.gz rails-8f72bc92e20b1242272714f253e23b256761ec1a.tar.bz2 rails-8f72bc92e20b1242272714f253e23b256761ec1a.zip |
Fixed test_rename_nonexistent_column for PostgreSQL
Also fixed ability to run migration_test.rb alone
[#616 state:resolved]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 4482b487dd..f9a2d9c47c 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -3,6 +3,7 @@ require 'bigdecimal/util' 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 @@ if ActiveRecord::Base.connection.supports_migrations? 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 |