Commit 1942b97d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #6760 from jvanbaarsen/label-color-lowercase

Determine label color based on lowercase name
parents 4881d493 28f1a5d7
......@@ -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