Commit 972338b2 authored by Sean Arnold's avatar Sean Arnold

Add spec for case with no images

parent 4f565864
...@@ -6,7 +6,7 @@ RSpec.describe AlertManagement::CreateAlertIssueService do ...@@ -6,7 +6,7 @@ RSpec.describe AlertManagement::CreateAlertIssueService do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) } let_it_be(:project) { create(:project, group: group) }
let_it_be(:alert) { create(:alert_management_alert, project: project) } let_it_be_with_reload(:alert) { create(:alert_management_alert, project: project) }
describe '#execute' do describe '#execute' do
subject(:execute) { described_class.new(alert, user).execute } subject(:execute) { described_class.new(alert, user).execute }
...@@ -30,6 +30,14 @@ RSpec.describe AlertManagement::CreateAlertIssueService do ...@@ -30,6 +30,14 @@ RSpec.describe AlertManagement::CreateAlertIssueService do
expect_image_matches(second_metric_image, image_2) expect_image_matches(second_metric_image, image_2)
end end
context 'when there are no metric images to copy' do
it 'has no images' do
incident = execute.payload[:issue]
expect(incident.metric_images.count).to eq(0)
end
end
private private
def expect_image_matches(image, image_expectation) def expect_image_matches(image, image_expectation)
......
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