diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 12:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 12:09:20 +0300 |
commit | fc1df8c8307fc5022f9e8aae04164c089d8fdf2e (patch) | |
tree | a759f58abf9e41200c48a60de73c84cab47a250d /spec/services | |
parent | c8df22c555ab707a705e57c4257fd3ed1ce7c3b0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/system_notes/issuables_service_spec.rb | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 3df620d1fea..5b87ec022ae 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -625,4 +625,14 @@ describe SystemNoteService do described_class.discussion_lock(issuable, double) end end + + describe '.auto_resolve_prometheus_alert' do + it 'calls IssuableService' do + expect_next_instance_of(::SystemNotes::IssuablesService) do |service| + expect(service).to receive(:auto_resolve_prometheus_alert) + end + + described_class.auto_resolve_prometheus_alert(noteable, project, author) + end + end end diff --git a/spec/services/system_notes/issuables_service_spec.rb b/spec/services/system_notes/issuables_service_spec.rb index c0aaa65971a..477f9eae39e 100644 --- a/spec/services/system_notes/issuables_service_spec.rb +++ b/spec/services/system_notes/issuables_service_spec.rb @@ -654,4 +654,16 @@ describe ::SystemNotes::IssuablesService do .to eq('resolved the corresponding error and closed the issue.') end end + + describe '#auto_resolve_prometheus_alert' do + subject { service.auto_resolve_prometheus_alert } + + it_behaves_like 'a system note' do + let(:action) { 'closed' } + end + + it 'creates the expected system note' do + expect(subject.note).to eq('automatically closed this issue because the alert resolved.') + end + end end |