Commit c7e9fbd3 authored by Tom Quirk's avatar Tom Quirk

Add gl_tab_counter_badge helper

This helper creates a badge element
to be used in GlTabs.
parent c5f329ce
......@@ -210,3 +210,10 @@ module TabHelper
current_page?(options)
end
end
def gl_tab_counter_badge(count)
content_tag(:span,
count,
class: 'badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge'
)
end
\ No newline at end of file
......@@ -150,4 +150,10 @@ RSpec.describe TabHelper do
end
end
end
describe 'gl_tab_counter_badge' do
it 'creates a tab counter badge' do
expect(gl_tab_counter_badge(1)).to eq('<span class="badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge">1</span>')
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