Commit 95ca6584 authored by Robert Speicher's avatar Robert Speicher

Add CommitRange directly to results Hash

parent 92c681a5
...@@ -56,7 +56,7 @@ module Gitlab ...@@ -56,7 +56,7 @@ module Gitlab
range = CommitRange.new(id, project) range = CommitRange.new(id, project)
if range.valid_commits? if range.valid_commits?
push_result(:commit_range, range.to_a) push_result(:commit_range, range)
url = url_for_commit_range(project, range) url = url_for_commit_range(project, range)
......
...@@ -65,12 +65,12 @@ describe Gitlab::ReferenceExtractor do ...@@ -65,12 +65,12 @@ describe Gitlab::ReferenceExtractor do
earlier_commit = project.commit('master~2') earlier_commit = project.commit('master~2')
subject.analyze("this references commits #{earlier_commit.sha[0..6]}...#{commit.sha[0..6]}") subject.analyze("this references commits #{earlier_commit.sha[0..6]}...#{commit.sha[0..6]}")
extracted = subject.commit_ranges extracted = subject.commit_ranges
expect(extracted.size).to eq(1) expect(extracted.size).to eq(1)
expect(extracted[0][0].sha).to eq(earlier_commit.sha) expect(extracted.first).to be_kind_of(CommitRange)
expect(extracted[0][0].message).to eq(earlier_commit.message) expect(extracted.first.commit_from).to eq earlier_commit
expect(extracted[0][1].sha).to eq(commit.sha) expect(extracted.first.commit_to).to eq commit
expect(extracted[0][1].message).to eq(commit.message)
end end
context 'with a project with an underscore' do context 'with a project with an underscore' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment