Commit 786a5a45 authored by Sean Arnold's avatar Sean Arnold

Tweaks to fix specs

parent ee20ecd3
...@@ -4,7 +4,8 @@ require 'spec_helper' ...@@ -4,7 +4,8 @@ require 'spec_helper'
RSpec.describe AlertManagement::AlertPresenter do RSpec.describe AlertManagement::AlertPresenter do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:generic_payload) do
let(:generic_payload) do
{ {
'title' => 'Alert title', 'title' => 'Alert title',
'start_time' => '2020-04-27T10:10:22.265949279Z', 'start_time' => '2020-04-27T10:10:22.265949279Z',
...@@ -12,6 +13,7 @@ RSpec.describe AlertManagement::AlertPresenter do ...@@ -12,6 +13,7 @@ RSpec.describe AlertManagement::AlertPresenter do
'runbook' => 'https://runbook.com' 'runbook' => 'https://runbook.com'
} }
end end
let_it_be(:alert) do let_it_be(:alert) do
build(:alert_management_alert, :with_description, :with_host, :with_service, :with_monitoring_tool, project: project, payload: generic_payload) build(:alert_management_alert, :with_description, :with_host, :with_service, :with_monitoring_tool, project: project, payload: generic_payload)
end end
......
...@@ -16,7 +16,7 @@ RSpec.describe AlertManagement::PrometheusAlertPresenter do ...@@ -16,7 +16,7 @@ RSpec.describe AlertManagement::PrometheusAlertPresenter do
} }
end end
let(:alert) do let!(:alert) do
create(:alert_management_alert, :prometheus, project: project, payload: payload) create(:alert_management_alert, :prometheus, project: project, payload: payload)
end end
......
...@@ -299,7 +299,7 @@ RSpec.describe Projects::Prometheus::AlertPresenter do ...@@ -299,7 +299,7 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it { is_expected.to eq(nil) } it { is_expected.to eq(nil) }
context 'alert management alert present' do context 'alert management alert present' do
let(:am_alert) { create(:alert_management_alert, project: project) } let_it_be(:am_alert) { create(:alert_management_alert, project: project) }
let(:alert) { create(:alerting_alert, project: project, payload: payload, alert: am_alert) } let(:alert) { create(:alerting_alert, project: project, payload: payload, alert: am_alert) }
it { is_expected.to eq("http://localhost/#{project.full_path}/-/alert_management/#{am_alert.id}/details") } it { is_expected.to eq("http://localhost/#{project.full_path}/-/alert_management/#{am_alert.id}/details") }
......
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