Skip to content

Commit

Permalink
subs spaces for hyphens in geomtype icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Dec 10, 2014
1 parent f456f23 commit b8b47fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/geoblacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def render_facet_tags(facet)
end

def layer_type_image(type)
content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{type.downcase}"
content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{type.downcase.gsub(' ', '-')}"
end

def layer_institution_image(institution)
Expand Down
6 changes: 6 additions & 0 deletions spec/helpers/geoblacklight_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
expect(html).to have_css 'a', text: 'Science', count: 1
end
end
describe '#layer_type_image' do
it 'lowercases and subs spaces for hyphens' do
html = Capybara.string(layer_type_image('TEst 123'))
expect(html).to have_css '.geoblacklight-test-123'
end
end
end

0 comments on commit b8b47fd

Please sign in to comment.