BigW Consortium Gitlab

Commit 28f1a5d7 by Jeroen van Baarsen

Determine label color based on lowercase name

parent 4881d493
......@@ -12,7 +12,7 @@ module LabelsHelper
def label_css_class(name)
klass = Gitlab::IssuesLabels
case name
case name.downcase
when *klass.warning_labels
'label-warning'
when *klass.neutral_labels
......
require 'spec_helper'
describe LabelsHelper do
describe '#label_css_class' do
it 'returns label-danger when given Bug as param' do
expect(label_css_class('bug')).to eq('label-danger')
end
it 'returns label-danger when given Bug as param' do
expect(label_css_class('Bug')).to eq('label-danger')
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