Commit 092ff52f authored by Vitali Tatarintev's avatar Vitali Tatarintev

Remove skip_settings_check from CreateIssueService

parent 355307a6
...@@ -17,8 +17,8 @@ module IncidentManagement ...@@ -17,8 +17,8 @@ module IncidentManagement
super(project, user, params) super(project, user, params)
end end
def execute(skip_settings_check: false) def execute
return error_with('setting disabled') unless skip_settings_check || incident_management_setting.create_issue? return error_with('setting disabled') unless incident_management_setting.create_issue?
return error_with('invalid alert') unless alert.valid? return error_with('invalid alert') unless alert.valid?
issue = create_issue issue = create_issue
......
...@@ -281,7 +281,6 @@ describe IncidentManagement::CreateIssueService do ...@@ -281,7 +281,6 @@ describe IncidentManagement::CreateIssueService do
setting.update!(create_issue: false) setting.update!(create_issue: false)
end end
context 'when skip_settings_check is false (default)' do
it 'returns an error' do it 'returns an error' do
expect(service) expect(service)
.to receive(:log_error) .to receive(:log_error)
...@@ -291,15 +290,6 @@ describe IncidentManagement::CreateIssueService do ...@@ -291,15 +290,6 @@ describe IncidentManagement::CreateIssueService do
end end
end end
context 'when skip_settings_check is true' do
subject { service.execute(skip_settings_check: true) }
it 'creates an issue' do
expect { subject }.to change(Issue, :count).by(1)
end
end
end
private private
def build_alert_payload(annotations: {}, starts_at: Time.current) def build_alert_payload(annotations: {}, starts_at: Time.current)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment