summaryrefslogtreecommitdiff
path: root/spec/presenters
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-10-03 18:13:13 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-10-04 00:09:48 -0300
commit1f54c9216f178e96010b28a74f04bae5848ef15d (patch)
tree7f5b63c6db133916be3cb20d94d30c0c64dc60d3 /spec/presenters
parentccfe6860079c6c75ab5a1f831cd62af0e355331e (diff)
downloadgitlab-ce-1f54c9216f178e96010b28a74f04bae5848ef15d.tar.gz
Reduce method calls while evaluating Projects::MergeRequestsController#show.json36876-mr-show-json-controller-perf-improvements
Diffstat (limited to 'spec/presenters')
-rw-r--r--spec/presenters/merge_request_presenter_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb
index 2187be0190d..5e114434a67 100644
--- a/spec/presenters/merge_request_presenter_spec.rb
+++ b/spec/presenters/merge_request_presenter_spec.rb
@@ -300,6 +300,10 @@ describe MergeRequestPresenter do
described_class.new(resource, current_user: user).remove_wip_path
end
+ before do
+ allow(resource).to receive(:work_in_progress?).and_return(true)
+ end
+
context 'when merge request enabled and has permission' do
it 'has remove_wip_path' do
allow(project).to receive(:merge_requests_enabled?) { true }