diff options
Diffstat (limited to 'spec/services/merge_requests/approval_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/approval_service_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/services/merge_requests/approval_service_spec.rb b/spec/services/merge_requests/approval_service_spec.rb index d30b2721a36..4d20d62b864 100644 --- a/spec/services/merge_requests/approval_service_spec.rb +++ b/spec/services/merge_requests/approval_service_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe MergeRequests::ApprovalService do describe '#execute' do let(:user) { create(:user) } - let(:merge_request) { create(:merge_request) } + let(:merge_request) { create(:merge_request, reviewers: [user]) } let(:project) { merge_request.project } let!(:todo) { create(:todo, user: user, project: project, target: merge_request) } @@ -59,6 +59,14 @@ RSpec.describe MergeRequests::ApprovalService do service.execute(merge_request) end + it 'removes attention requested state' do + expect(MergeRequests::RemoveAttentionRequestedService).to receive(:new) + .with(project: project, current_user: user, merge_request: merge_request, user: user) + .and_call_original + + service.execute(merge_request) + end + context 'with remaining approvals' do it 'fires an approval webhook' do expect(service).to receive(:execute_hooks).with(merge_request, 'approved') |