summaryrefslogtreecommitdiff
path: root/spec/models/issue_spec.rb
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-10-19 14:30:17 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-10-20 12:55:14 +0200
commit493367108eef14c8517c6d023ec46267c1e706cf (patch)
tree62ae94fac2284b8424bc4e0abbe3acdda3874982 /spec/models/issue_spec.rb
parentc08435e3c25f0a7a705ed8a49b16dde176b41a40 (diff)
downloadgitlab-ce-493367108eef14c8517c6d023ec46267c1e706cf.tar.gz
Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method14192-issues-closed-by-merge-requests-using-metrics-data
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 3b8b743af2d..60d30eb7418 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -100,11 +100,17 @@ describe Issue, models: true do
end
it 'returns the merge request to close this issue' do
- allow(mr).to receive(:closes_issue?).with(issue).and_return(true)
+ mr
expect(issue.closed_by_merge_requests).to eq([mr])
end
+ it "returns an empty array when the merge request is closed already" do
+ closed_mr
+
+ expect(issue.closed_by_merge_requests).to eq([])
+ end
+
it "returns an empty array when the current issue is closed already" do
expect(closed_issue.closed_by_merge_requests).to eq([])
end