diff options
Diffstat (limited to 'spec/services/system_notes/alert_management_service_spec.rb')
-rw-r--r-- | spec/services/system_notes/alert_management_service_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/system_notes/alert_management_service_spec.rb b/spec/services/system_notes/alert_management_service_spec.rb index 943d7f55af4..4ebaa54534c 100644 --- a/spec/services/system_notes/alert_management_service_spec.rb +++ b/spec/services/system_notes/alert_management_service_spec.rb @@ -7,6 +7,19 @@ RSpec.describe ::SystemNotes::AlertManagementService do let_it_be(:project) { create(:project, :repository) } let_it_be(:noteable) { create(:alert_management_alert, :with_issue, :acknowledged, project: project) } + describe '#create_new_alert' do + subject { described_class.new(noteable: noteable, project: project).create_new_alert('Some Service') } + + it_behaves_like 'a system note' do + let(:author) { User.alert_bot } + let(:action) { 'new_alert_added' } + end + + it 'has the appropriate message' do + expect(subject.note).to eq('logged an alert from **Some Service**') + end + end + describe '#change_alert_status' do subject { described_class.new(noteable: noteable, project: project, author: author).change_alert_status(noteable) } |