diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-13 00:58:29 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-26 22:48:31 +0300 |
commit | 136ab73803850c10588b369862b1e5524849d31c (patch) | |
tree | 202968fc761b306920f04976fed18b80d2701dfa /spec/models | |
parent | 9d032cddf5575e2233c81142a3ebc609cd43a47e (diff) |
Update CommitRange#to_reference to use full SHAs
We only want them shortened by the filter, which calls to_s
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/commit_range_spec.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 2d347a335a1..e7fb43ff335 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -1,6 +1,12 @@ require 'spec_helper' describe CommitRange do + describe 'modules' do + subject { described_class } + + it { is_expected.to include_module(Referable) } + end + let(:sha_from) { 'f3f85602' } let(:sha_to) { 'e86e1013' } @@ -11,10 +17,14 @@ describe CommitRange do expect { described_class.new("Foo") }.to raise_error end - describe 'modules' do - subject { described_class } + describe '#to_s' do + it 'is correct for three-dot syntax' do + expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}" + end - it { is_expected.to include_module(Referable) } + it 'is correct for two-dot syntax' do + expect(range2.to_s).to eq "#{sha_from[0..7]}..#{sha_to[0..7]}" + end end describe '#to_reference' do @@ -34,16 +44,6 @@ describe CommitRange do end end - describe '#to_s' do - it 'is correct for three-dot syntax' do - expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}" - end - - it 'is correct for two-dot syntax' do - expect(range2.to_s).to eq "#{sha_from[0..7]}..#{sha_to[0..7]}" - end - end - describe '#reference_title' do it 'returns the correct String for three-dot ranges' do expect(range.reference_title).to eq "Commits #{sha_from} through #{sha_to}" |