diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-01 12:58:45 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-01 12:58:45 +0100 |
commit | 62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909 (patch) | |
tree | 09df506c6905a490613a6fd31edc8004b3c15495 /spec/models/commit_range_spec.rb | |
parent | bd4ab21c07061e06166b08d86157e4004665ccbc (diff) | |
download | gitlab-ce-62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909.tar.gz |
Render commit reference using short sha, but include full sha in comment.
Diffstat (limited to 'spec/models/commit_range_spec.rb')
-rw-r--r-- | spec/models/commit_range_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 58283f06972..3c1009a2eb0 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -38,15 +38,31 @@ describe CommitRange do let(:cross) { create(:project) } it 'returns a String reference to the object' do - expect(range.to_reference).to eq "#{sha_from}...#{sha_to}" + expect(range.to_reference).to eq "#{full_sha_from}...#{full_sha_to}" end it 'returns a String reference to the object' do - expect(range2.to_reference).to eq "#{sha_from}..#{sha_to}" + expect(range2.to_reference).to eq "#{full_sha_from}..#{full_sha_to}" end it 'supports a cross-project reference' do - expect(range.to_reference(cross)).to eq "#{project.to_reference}@#{sha_from}...#{sha_to}" + expect(range.to_reference(cross)).to eq "#{project.to_reference}@#{full_sha_from}...#{full_sha_to}" + end + end + + describe '#reference_link_text' do + let(:cross) { create(:project) } + + it 'returns a String reference to the object' do + expect(range.reference_link_text).to eq "#{sha_from}...#{sha_to}" + end + + it 'returns a String reference to the object' do + expect(range2.reference_link_text).to eq "#{sha_from}..#{sha_to}" + end + + it 'supports a cross-project reference' do + expect(range.reference_link_text(cross)).to eq "#{project.to_reference}@#{sha_from}...#{sha_to}" end end |