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:
authorSean McGivern <sean@gitlab.com>2017-03-03 17:25:52 +0300
committerSean McGivern <sean@gitlab.com>2017-03-06 17:18:49 +0300
commit9f612cc428c47a578bef8869e2e93966c021e655 (patch)
treeff03a6c9437a5a5b68219bf66978b756b514116c /spec/models/external_issue_spec.rb
parent86d1e42ab34d15a801b97d4d1b7812fb4259f7e5 (diff)
Fix issues mentioned but not closed for JIRA
The `ReferenceExtractor` would return an array of `ExternalIssue` objects, and then perform `Array#-` to remove the issues closed. `ExternalIssue`s had `==` defined, but not `hash` or `eql?`, which are used by `Array#-`.
Diffstat (limited to 'spec/models/external_issue_spec.rb')
-rw-r--r--spec/models/external_issue_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/external_issue_spec.rb b/spec/models/external_issue_spec.rb
index 2debe1289a3..cd50bda8996 100644
--- a/spec/models/external_issue_spec.rb
+++ b/spec/models/external_issue_spec.rb
@@ -42,4 +42,12 @@ describe ExternalIssue, models: true do
expect(issue.project_id).to eq(project.id)
end
end
+
+ describe '#hash' do
+ it 'returns the hash of its [class, to_s] pair' do
+ issue_2 = described_class.new(issue.to_s, project)
+
+ expect(issue.hash).to eq(issue_2.hash)
+ end
+ end
end