summaryrefslogtreecommitdiff
path: root/spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb')
-rw-r--r--spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb b/spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb
new file mode 100644
index 00000000000..44e20df1130
--- /dev/null
+++ b/spec/migrations/20220321234317_remove_all_issuable_escalation_statuses_spec.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe RemoveAllIssuableEscalationStatuses do
+ let(:namespaces) { table(:namespaces) }
+ let(:projects) { table(:projects) }
+ let(:issues) { table(:issues) }
+ let(:statuses) { table(:incident_management_issuable_escalation_statuses) }
+ let(:namespace) { namespaces.create!(name: 'foo', path: 'foo') }
+ let(:project) { projects.create!(namespace_id: namespace.id) }
+
+ it 'removes all escalation status records' do
+ issue = issues.create!(project_id: project.id, issue_type: 1)
+ statuses.create!(issue_id: issue.id)
+
+ expect { migrate! }.to change(statuses, :count).from(1).to(0)
+ end
+end