2020-04-22 19:07:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Projects::Prometheus::Alerts::DestroyService do
|
2020-04-22 19:07:51 +05:30
|
|
|
let_it_be(:project) { create(:project) }
|
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:alert) { create(:prometheus_alert, project: project) }
|
|
|
|
|
2022-01-26 12:08:38 +05:30
|
|
|
let(:service) { described_class.new(project: project, current_user: user, params: nil) }
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
describe '#execute' do
|
|
|
|
subject { service.execute(alert) }
|
|
|
|
|
|
|
|
it 'deletes the alert' do
|
|
|
|
expect(subject).to be_truthy
|
|
|
|
|
|
|
|
expect(alert).to be_destroyed
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|