summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/alert_notification_service_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/alert_notification_service_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/alert_notification_service_shared_examples.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/shared_examples/alert_notification_service_shared_examples.rb b/spec/support/shared_examples/alert_notification_service_shared_examples.rb
index 7bd6df8c608..fc935effe0e 100644
--- a/spec/support/shared_examples/alert_notification_service_shared_examples.rb
+++ b/spec/support/shared_examples/alert_notification_service_shared_examples.rb
@@ -27,3 +27,18 @@ RSpec.shared_examples 'Alert Notification Service sends no notifications' do |ht
end
end
end
+
+RSpec.shared_examples 'creates status-change system note for an auto-resolved alert' do
+ it 'has 2 new system notes' do
+ expect { subject }.to change(Note, :count).by(2)
+ expect(Note.last.note).to include('Resolved')
+ end
+end
+
+# Requires `source` to be defined
+RSpec.shared_examples 'creates single system note based on the source of the alert' do
+ it 'has one new system note' do
+ expect { subject }.to change(Note, :count).by(1)
+ expect(Note.last.note).to include(source)
+ end
+end