aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/command_recorder_test.rb
diff options
context:
space:
mode:
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