diff options
Diffstat (limited to 'spec/services')
4 files changed, 9 insertions, 2 deletions
diff --git a/spec/services/issues/reopen_service_spec.rb b/spec/services/issues/reopen_service_spec.rb index 3b617d4ca54..2a56075419b 100644 --- a/spec/services/issues/reopen_service_spec.rb +++ b/spec/services/issues/reopen_service_spec.rb @@ -20,7 +20,7 @@ describe Issues::ReopenService do end end - context 'when user is authrized to reopen issue' do + context 'when user is authorized to reopen issue' do let(:user) { create(:user) } before do diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index 9dd235f6660..5d96b5ce27c 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -49,6 +49,7 @@ describe MergeRequests::MergeService do issue = create :issue, project: project commit = double('commit', safe_message: "Fixes #{issue.to_reference}") allow(merge_request).to receive(:commits).and_return([commit]) + merge_request.cache_merge_request_closes_issues! service.execute(merge_request) diff --git a/spec/services/merge_requests/post_merge_service_spec.rb b/spec/services/merge_requests/post_merge_service_spec.rb index ba2b062875b..5ad6f5528f9 100644 --- a/spec/services/merge_requests/post_merge_service_spec.rb +++ b/spec/services/merge_requests/post_merge_service_spec.rb @@ -53,7 +53,7 @@ describe MergeRequests::PostMergeService do allow(project).to receive(:default_branch).and_return('foo') issue = create(:issue, project: project) - allow(merge_request).to receive(:closes_issues).and_return([issue]) + allow(merge_request).to receive(:visible_closing_issues_for).and_return([issue]) allow_any_instance_of(Issues::CloseService).to receive(:execute).with(issue, commit: merge_request).and_raise expect { described_class.new(project, user, {}).execute(merge_request) }.to raise_error diff --git a/spec/services/merge_requests/reopen_service_spec.rb b/spec/services/merge_requests/reopen_service_spec.rb index e10eaa95da4..21e71509ed6 100644 --- a/spec/services/merge_requests/reopen_service_spec.rb +++ b/spec/services/merge_requests/reopen_service_spec.rb @@ -47,6 +47,12 @@ describe MergeRequests::ReopenService do end end + it 'caches merge request closing issues' do + expect(merge_request).to receive(:cache_merge_request_closes_issues!) + + described_class.new(project, user, {}).execute(merge_request) + end + it 'updates metrics' do metrics = merge_request.metrics service = double(MergeRequestMetricsService) |