File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -1177,6 +1177,42 @@ def test_removing_columns
1177
1177
assert column ( :qualification_experience )
1178
1178
end
1179
1179
1180
+ def test_adding_timestamps
1181
+ with_bulk_change_table do |t |
1182
+ t . string :title
1183
+ end
1184
+
1185
+ assert column ( :title )
1186
+
1187
+ assert_queries ( 1 ) do
1188
+ with_bulk_change_table do |t |
1189
+ t . timestamps
1190
+ t . remove :title
1191
+ end
1192
+ end
1193
+
1194
+ [ :created_at , :updated_at ] . each { |c | assert column ( c ) }
1195
+ assert_not column ( :title )
1196
+ end
1197
+
1198
+ def test_removing_timestamps
1199
+ with_bulk_change_table do |t |
1200
+ t . timestamps
1201
+ end
1202
+
1203
+ [ :created_at , :updated_at ] . each { |c | assert column ( c ) }
1204
+
1205
+ assert_queries ( 1 ) do
1206
+ with_bulk_change_table do |t |
1207
+ t . remove_timestamps
1208
+ t . string :title
1209
+ end
1210
+ end
1211
+
1212
+ [ :created_at , :updated_at ] . each { |c | assert_not column ( c ) }
1213
+ assert column ( :title )
1214
+ end
1215
+
1180
1216
def test_adding_indexes
1181
1217
with_bulk_change_table do |t |
1182
1218
t . string :username
You can’t perform that action at this time.
0 commit comments