Commit ce77ede5 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix alert EE specs

parent daf772c2
FactoryBot.define do
factory :prometheus_alert do
project
environment
prometheus_metric
operator :gt
threshold 1
environment do |alert|
build(:environment, project: alert.project)
end
prometheus_metric do |alert|
build(:prometheus_metric, project: alert.project)
end
end
end
......@@ -13,7 +13,7 @@ describe Projects::Prometheus::Metrics::DestroyService do
context 'when metric has a prometheus alert associated' do
it 'schedules a prometheus alert update' do
create(:prometheus_alert, prometheus_metric: metric)
create(:prometheus_alert, project: metric.project, prometheus_metric: metric)
schedule_update_service = spy
allow(::Clusters::Applications::ScheduleUpdateService).to receive(:new).and_return(schedule_update_service)
......
......@@ -13,7 +13,7 @@ describe Projects::Prometheus::Metrics::UpdateService do
let(:schedule_update_service) { spy }
before do
create(:prometheus_alert, prometheus_metric: metric)
create(:prometheus_alert, project: metric.project, prometheus_metric: metric)
allow(::Clusters::Applications::ScheduleUpdateService).to receive(:new).and_return(schedule_update_service)
end
......
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