spec/helpers/geoblacklight_helper_spec.rb in geoblacklight-2.3.0 vs spec/helpers/geoblacklight_helper_spec.rb in geoblacklight-2.4.0
- old
+ new
@@ -324,6 +324,19 @@
it 'renders an empty span' do
expect(helper.render_help_text_entry('foo', 'bar')).to eq '<span class="help-text translation-missing"></span>'
end
end
end
+
+ describe '#relations_icon' do
+ it 'renders a goemetry type if configured' do
+ allow(Settings).to receive(:USE_GEOM_FOR_RELATIONS_ICON).and_return(true)
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
+ expect(html.title.strip).to eq 'Polygon'
+ end
+ it 'renders provided icon if not configured to use geometry' do
+ allow(Settings).to receive(:USE_GEOM_FOR_RELATIONS_ICON).and_return(false)
+ html = Capybara.string(helper.relations_icon({ 'layer_geom_type_s' => 'polygon' }, 'leaf'))
+ expect(html.title.strip).to eq 'Leaf'
+ end
+ end
end