aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/command_recorder_test.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2012-11-19 01:34:12 -0500
committerMarc-Andre Lafortune <github@marc-andre.ca>2012-12-21 13:54:52 -0500
commite28ddea098d0422bae08324fb1d72f2b100152d0 (patch)
tree33ddc93d70fa85e02d119de65a73816f3beece7a /activerecord/test/cases/migration/command_recorder_test.rb
parentaf871a0623740f53a4dca5858b78efb35f0e32e0 (diff)
downloadrails-e28ddea098d0422bae08324fb1d72f2b100152d0.tar.gz
rails-e28ddea098d0422bae08324fb1d72f2b100152d0.tar.bz2
rails-e28ddea098d0422bae08324fb1d72f2b100152d0.zip
Differentiate between remove_column and remove_columns. Make remove_column reversible.
[#8267]
Diffstat (limited to 'activerecord/test/cases/migration/command_recorder_test.rb')
-rw-r--r--activerecord/test/cases/migration/command_recorder_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb
index 66be0df4cd..8ebc1adaa6 100644
--- a/activerecord/test/cases/migration/command_recorder_test.rb
+++ b/activerecord/test/cases/migration/command_recorder_test.rb
@@ -127,7 +127,18 @@ module ActiveRecord
def test_invert_add_column
remove = @recorder.inverse_of :add_column, [:table, :column, :type, {}]
- assert_equal [:remove_column, [:table, :column]], remove
+ assert_equal [:remove_column, [:table, :column, :type, {}]], remove
+ end
+
+ def test_invert_remove_column
+ add = @recorder.inverse_of :remove_column, [:table, :column, :type, {}]
+ assert_equal [:add_column, [:table, :column, :type, {}]], add
+ end
+
+ def test_invert_remove_column_without_type
+ assert_raises(ActiveRecord::IrreversibleMigration) do
+ @recorder.inverse_of :remove_column, [:table, :column]
+ end
end
def test_invert_rename_column