Skip to content

Commit

Permalink
Merge e0b7fad into 899d649
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Jul 24, 2018
2 parents 899d649 + e0b7fad commit 64b5cfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/helpers/geoblacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ def render_facet_tags(facet)
end

def geoblacklight_icon(name)
icon_name = name ? name.parameterize : 'none'
content_tag :span,
'',
class: "geoblacklight-icon geoblacklight-#{name.parameterize}",
class: "geoblacklight-icon geoblacklight-#{icon_name}",
title: name
end

Expand Down
4 changes: 4 additions & 0 deletions spec/helpers/geoblacklight_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
expect(html).to have_css ".geoblacklight-#{value}"
end
end
it 'handles nil values' do
html = Capybara.string(geoblacklight_icon(nil))
expect(html).to have_css '.geoblacklight-none'
end
end

describe '#proper_case_format' do
Expand Down

0 comments on commit 64b5cfd

Please sign in to comment.