diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/services/system_note_service_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 66f9b5d092f..58fa772fefb 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SystemNoteService do +RSpec.describe SystemNoteService do include Gitlab::Routing include RepoHelpers include AssetsHelpers @@ -661,4 +661,48 @@ describe SystemNoteService do described_class.design_discussion_added(discussion_note) end end + + describe '.approve_mr' do + it 'calls MergeRequestsService' do + expect_next_instance_of(::SystemNotes::MergeRequestsService) do |service| + expect(service).to receive(:approve_mr) + end + + described_class.approve_mr(noteable, author) + end + end + + describe '.unapprove_mr' do + it 'calls MergeRequestsService' do + expect_next_instance_of(::SystemNotes::MergeRequestsService) do |service| + expect(service).to receive(:unapprove_mr) + end + + described_class.unapprove_mr(noteable, author) + end + end + + describe '.change_alert_status' do + let(:alert) { build(:alert_management_alert) } + + it 'calls AlertManagementService' do + expect_next_instance_of(SystemNotes::AlertManagementService) do |service| + expect(service).to receive(:change_alert_status).with(alert) + end + + described_class.change_alert_status(alert, author) + end + end + + describe '.new_alert_issue' do + let(:alert) { build(:alert_management_alert, :with_issue) } + + it 'calls AlertManagementService' do + expect_next_instance_of(SystemNotes::AlertManagementService) do |service| + expect(service).to receive(:new_alert_issue).with(alert, alert.issue) + end + + described_class.new_alert_issue(alert, alert.issue, author) + end + end end |