Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-06 15:09:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-06 15:09:00 +0300
commit9fc7cdf0b7a3c8c3528ec930f59fde110683d8fd (patch)
treedaddd5806e8a63e7b2fb5d2820ceab9aafe7574c /spec/services/alert_management
parentc203c40cda9df83cc33f9d69a24593ef4de1148d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/alert_management')
-rw-r--r--spec/services/alert_management/update_alert_status_service_spec.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/services/alert_management/update_alert_status_service_spec.rb b/spec/services/alert_management/update_alert_status_service_spec.rb
index 6883591282f..a3360c3e263 100644
--- a/spec/services/alert_management/update_alert_status_service_spec.rb
+++ b/spec/services/alert_management/update_alert_status_service_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe AlertManagement::UpdateAlertStatusService do
end
end
- let(:new_status) { Types::AlertManagement::StatusEnum.values['ACKNOWLEDGED'].value }
+ let(:new_status) { AlertManagement::Alert::STATUSES[:acknowledged] }
let(:can_update) { true }
subject(:response) { service.execute }
@@ -45,6 +45,23 @@ RSpec.describe AlertManagement::UpdateAlertStatusService do
expect { response }.to change { alert.acknowledged? }.to(true)
end
+ context 'resolving status' do
+ let(:new_status) { AlertManagement::Alert::STATUSES[:resolved] }
+
+ it 'updates the status' do
+ expect { response }.to change { alert.resolved? }.to(true)
+ end
+
+ context 'user has a pending todo' do
+ let(:user) { create(:user) }
+ let!(:todo) { create(:todo, :pending, target: alert, user: user, project: alert.project) }
+
+ it 'resolves the todo' do
+ expect { response }.to change { todo.reload.state }.from('pending').to('done')
+ end
+ end
+ end
+
context 'when user has no permissions' do
let(:can_update) { false }