Commit 28a2e725 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '344317-snippet-badge-pajamas' into 'master'

Update snippet search badge to use pajamas

See merge request gitlab-org/gitlab!77726
parents 90ab79b4 b1fd7238
...@@ -26,11 +26,8 @@ module SnippetsHelper ...@@ -26,11 +26,8 @@ module SnippetsHelper
return unless attrs = snippet_badge_attributes(snippet) return unless attrs = snippet_badge_attributes(snippet)
icon_name, text = attrs icon_name, text = attrs
tag.span(class: %w[badge badge-gray]) do
concat(sprite_icon(icon_name, size: 14, css_class: 'gl-vertical-align-middle')) gl_badge_tag(text, icon: icon_name)
concat(' ')
concat(text)
end
end end
def snippet_badge_attributes(snippet) def snippet_badge_attributes(snippet)
......
...@@ -5,6 +5,7 @@ require 'spec_helper' ...@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe SnippetsHelper do RSpec.describe SnippetsHelper do
include Gitlab::Routing include Gitlab::Routing
include IconsHelper include IconsHelper
include BadgesHelper
let_it_be(:public_personal_snippet) { create(:personal_snippet, :public, :repository) } let_it_be(:public_personal_snippet) { create(:personal_snippet, :public, :repository) }
let_it_be(:public_project_snippet) { create(:project_snippet, :public, :repository) } let_it_be(:public_project_snippet) { create(:project_snippet, :public, :repository) }
...@@ -72,7 +73,7 @@ RSpec.describe SnippetsHelper do ...@@ -72,7 +73,7 @@ RSpec.describe SnippetsHelper do
let(:visibility) { :private } let(:visibility) { :private }
it 'returns the snippet badge' do it 'returns the snippet badge' do
expect(subject).to eq "<span class=\"badge badge-gray\">#{sprite_icon('lock', size: 14, css_class: 'gl-vertical-align-middle')} private</span>" expect(subject).to eq gl_badge_tag('private', icon: 'lock')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment