Sha256: edeb5bfc0d0abdcd7c465774cc072444356c7ef7004637d76f881d2ff98fd9b7
Contents?: true
Size: 1.69 KB
Versions: 3
Compression:
Stored size: 1.69 KB
Contents
require 'spec_helper' describe GeoblacklightHelper do include GeoblacklightHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TranslationHelper describe '#render_facet_links' do it 'should contain unique links' do expect(self).to receive(:catalog_index_path).exactly(3).times.and_return("http://example.com/catalog?f[dc_subject_sm][]=category") html = Capybara.string(render_facet_links('dc_subject_sm', ['Test', 'Test', 'Earth', 'Science'])) expect(html).to have_css 'a', count: 3 expect(html).to have_css 'a', text: 'Test', count: 1 expect(html).to have_css 'a', text: 'Earth', count: 1 expect(html).to have_css 'a', text: 'Science', count: 1 end end describe '#geoblacklight_icon' do it 'lowercases and subs spaces for hyphens' do html = Capybara.string(geoblacklight_icon('TEst 123')) expect(html).to have_css '.geoblacklight-test-123' end end describe '#proper_case_format' do it 'returns a properly cased format' do expect(proper_case_format('GEOJSON')).to eq 'GeoJSON' end end describe '#download_text' do it 'returns download text concatenated with proper case format' do expect(download_text('GEOJSON')).to eq 'Download GeoJSON' end end describe '#geoblacklight_basemap' do let(:blacklight_config) { double } it 'without configuration' do expect(blacklight_config).to receive(:basemap_provider).and_return(nil) expect(geoblacklight_basemap).to eq 'mapquest' end it 'with custom configuration' do expect(blacklight_config).to receive(:basemap_provider).and_return('positron') expect(geoblacklight_basemap).to eq 'positron' end end end
Version data entries
3 entries across 3 versions & 1 rubygems