aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2011-06-25 00:01:59 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2011-06-25 17:17:02 +0530
commitc278a2c5e109204ec8a47fcbfdfc327aad7996ce (patch)
tree9aa75fd3a1a81f42aedfdc3786165cc40f5f4f1b /activerecord/test/cases/migration
parent7e56bf724479ce92eff2f806573f382957f3a2b4 (diff)
downloadrails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.tar.gz
rails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.tar.bz2
rails-c278a2c5e109204ec8a47fcbfdfc327aad7996ce.zip
record unsupported methods in CommandRecorder instead of letting the unsupported methods go through to the underlying db causing errors like duplicate columns to occur when rolling back migrations
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r--activerecord/test/cases/migration/command_recorder_test.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb
index 0f79c99e1a..a03c80bf93 100644
--- a/activerecord/test/cases/migration/command_recorder_test.rb
+++ b/activerecord/test/cases/migration/command_recorder_test.rb
@@ -14,9 +14,11 @@ module ActiveRecord
assert recorder.respond_to?(:america)
end
- def test_send_calls_super
- assert_raises(NoMethodError) do
- @recorder.send(:non_existing_method, :horses)
+ def test_non_existing_method_records_and_raises_on_inversion
+ @recorder.send(:non_existing_method, :horses)
+ assert_equal 1, @recorder.commands.length
+ assert_raises(ActiveRecord::IrreversibleMigration) do
+ @recorder.inverse
end
end