diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-10-19 15:30:17 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-10-20 13:55:14 +0300 |
commit | 493367108eef14c8517c6d023ec46267c1e706cf (patch) | |
tree | 62ae94fac2284b8424bc4e0abbe3acdda3874982 /spec/models | |
parent | c08435e3c25f0a7a705ed8a49b16dde176b41a40 (diff) |
Use MergeRequestsClosingIssues cache data on Issue#closed_by_merge_requests method
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/issue_spec.rb | 8 |
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 |