summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index ad2ac143d97..27eb02a870b 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -1,8 +1,28 @@
require 'spec_helper'
describe Commit do
- let(:project) { create :project }
- let(:commit) { project.commit }
+ let(:project) { create(:project) }
+ let(:commit) { project.commit }
+
+ describe 'modules' do
+ subject { described_class }
+
+ it { is_expected.to include_module(Mentionable) }
+ it { is_expected.to include_module(Participable) }
+ it { is_expected.to include_module(Referable) }
+ it { is_expected.to include_module(StaticModel) }
+ end
+
+ describe '#to_reference' do
+ it 'returns a String reference to the object' do
+ 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.id}"
+ end
+ end
describe '#title' do
it "returns no_commit_message when safe_message is blank" do