Commit b1fd7238 authored by Alexander Turinske's avatar Alexander Turinske

Update snippet search badge to use pajamas

- use ruby badge helper

Changelog: changed
parent 96d653f8
......@@ -26,11 +26,8 @@ module SnippetsHelper
return unless attrs = snippet_badge_attributes(snippet)
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'))
concat(' ')
concat(text)
end
gl_badge_tag(text, icon: icon_name)
end
def snippet_badge_attributes(snippet)
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe SnippetsHelper do
include Gitlab::Routing
include IconsHelper
include BadgesHelper
let_it_be(:public_personal_snippet) { create(:personal_snippet, :public, :repository) }
let_it_be(:public_project_snippet) { create(:project_snippet, :public, :repository) }
......@@ -72,7 +73,7 @@ RSpec.describe SnippetsHelper do
let(:visibility) { :private }
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
......
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