summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-01 12:58:45 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-01 12:58:45 +0100
commit62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909 (patch)
tree09df506c6905a490613a6fd31edc8004b3c15495 /spec/models/commit_spec.rb
parentbd4ab21c07061e06166b08d86157e4004665ccbc (diff)
downloadgitlab-ce-62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909.tar.gz
Render commit reference using short sha, but include full sha in comment.
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index 1aaa927c216..974b52c1833 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -15,12 +15,23 @@ describe Commit do
describe '#to_reference' do
it 'returns a String reference to the object' do
- expect(commit.to_reference).to eq commit.short_id
+ expect(commit.to_reference).to eq commit.id
end
it 'supports a cross-project reference' do
cross = double('project')
- expect(commit.to_reference(cross)).to eq "#{project.to_reference}@#{commit.short_id}"
+ expect(commit.to_reference(cross)).to eq "#{project.to_reference}@#{commit.id}"
+ end
+ end
+
+ describe '#reference_link_text' do
+ it 'returns a String reference to the object' do
+ expect(commit.reference_link_text).to eq commit.short_id
+ end
+
+ it 'supports a cross-project reference' do
+ cross = double('project')
+ expect(commit.reference_link_text(cross)).to eq "#{project.to_reference}@#{commit.short_id}"
end
end
@@ -88,7 +99,7 @@ eos
subject { create(:project).commit }
let(:author) { create(:user, email: subject.author_email) }
- let(:backref_text) { "commit #{subject.short_id}" }
+ let(:backref_text) { "commit #{subject.id}" }
let(:set_mentionable_text) do
->(txt) { allow(subject).to receive(:safe_message).and_return(txt) }
end