diff options
Diffstat (limited to 'spec/presenters/commit_presenter_spec.rb')
-rw-r--r-- | spec/presenters/commit_presenter_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/presenters/commit_presenter_spec.rb b/spec/presenters/commit_presenter_spec.rb index eba393da2b7..5ac270a8df8 100644 --- a/spec/presenters/commit_presenter_spec.rb +++ b/spec/presenters/commit_presenter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe CommitPresenter do +RSpec.describe CommitPresenter, feature_category: :source_code_management do let(:commit) { project.commit } let(:presenter) { described_class.new(commit, current_user: user) } @@ -95,4 +95,15 @@ RSpec.describe CommitPresenter do expect(presenter.signature_html).to eq(signature) end end + + describe '#tags_for_display' do + subject { presenter.tags_for_display } + + let(:stubbed_tags) { %w[refs/tags/v1.0 refs/tags/v1.1] } + + it 'removes the refs prefix from tags' do + allow(commit).to receive(:referenced_by).and_return(stubbed_tags) + expect(subject).to eq(%w[v1.0 v1.1]) + end + end end |