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:
Diffstat (limited to 'spec/services/issues/close_service_spec.rb')
-rw-r--r--spec/services/issues/close_service_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb
index 8f5bd4566ec..7a54373963e 100644
--- a/spec/services/issues/close_service_spec.rb
+++ b/spec/services/issues/close_service_spec.rb
@@ -18,26 +18,26 @@ describe Issues::CloseService, services: true do
let(:service) { described_class.new(project, user) }
it 'checks if the user is authorized to update the issue' do
- expect(service).to receive(:can?).with(user, :update_issue, issue)
- .and_call_original
+ expect(service).to receive(:can?).with(user, :update_issue, issue).
+ and_call_original
service.execute(issue)
end
it 'does not close the issue when the user is not authorized to do so' do
- allow(service).to receive(:can?).with(user, :update_issue, issue)
- .and_return(false)
+ allow(service).to receive(:can?).with(user, :update_issue, issue).
+ and_return(false)
expect(service).not_to receive(:close_issue)
expect(service.execute(issue)).to eq(issue)
end
it 'closes the issue when the user is authorized to do so' do
- allow(service).to receive(:can?).with(user, :update_issue, issue)
- .and_return(true)
+ allow(service).to receive(:can?).with(user, :update_issue, issue).
+ and_return(true)
- expect(service).to receive(:close_issue)
- .with(issue, commit: nil, notifications: true, system_note: true)
+ expect(service).to receive(:close_issue).
+ with(issue, commit: nil, notifications: true, system_note: true)
service.execute(issue)
end