summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-23 13:52:35 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-25 14:41:06 -0400
commitc11d3c5789f2d77059b6d132af7b9fda9651ede5 (patch)
tree563c18af3564503ea349997905a373c32620e06a
parent81a21e57961356a0924b7b1529696f79eded4630 (diff)
downloadgitlab-ce-c11d3c5789f2d77059b6d132af7b9fda9651ede5.tar.gz
Remove param from CommitRange#to_s
-rw-r--r--app/models/commit_range.rb8
-rw-r--r--spec/models/commit_range_spec.rb20
2 files changed, 6 insertions, 22 deletions
diff --git a/app/models/commit_range.rb b/app/models/commit_range.rb
index 19b1a218e45..66daa072c9e 100644
--- a/app/models/commit_range.rb
+++ b/app/models/commit_range.rb
@@ -67,12 +67,8 @@ class CommitRange
end
end
- def to_s(short: true)
- if short
- "#{sha_from[0..7]}#{notation}#{sha_to[0..7]}"
- else
- "#{sha_from}#{notation}#{sha_to}"
- end
+ def to_s
+ "#{sha_from[0..7]}#{notation}#{sha_to[0..7]}"
end
# Returns a String for use in a link's title attribute
diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb
index 474d60ff091..8412c7d2140 100644
--- a/spec/models/commit_range_spec.rb
+++ b/spec/models/commit_range_spec.rb
@@ -39,24 +39,12 @@ describe CommitRange do
end
describe '#to_s' do
- context 'with short IDs' 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
+ it 'is correct for three-dot syntax' do
+ expect(range.to_s).to eq "#{sha_from[0..7]}...#{sha_to[0..7]}"
end
- context 'with full IDs' do
- it 'is correct for three-dot syntax' do
- expect(range.to_s(short: false)).to eq "#{sha_from}...#{sha_to}"
- end
-
- it 'is correct for two-dot syntax' do
- expect(range2.to_s(short: false)).to eq "#{sha_from}..#{sha_to}"
- 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