spec/helpers/geoblacklight_helper_spec.rb in geoblacklight-1.9.1 vs spec/helpers/geoblacklight_helper_spec.rb in geoblacklight-2.0.0

- old
+ new

@@ -13,22 +13,10 @@ expect(html).to have_css 'a', text: 'Earth', count: 1 expect(html).to have_css 'a', text: 'Science', count: 1 end end - describe '#sms_helper' do - it 'generates an icon for SMS messaging' do - expect(sms_helper).to eq('<i class="fa fa-mobile fa-fw"></i> SMS This') - end - end - - describe '#email_helper' do - it 'generates an icon for e-mail messaging' do - expect(email_helper).to eq('<i class="fa fa-envelope fa-fw"></i> Email') - end - end - describe '#geoblacklight_icon' do it 'replaces special characters, lowercases, and subs spaces for hyphens' do html = Capybara.string(geoblacklight_icon('TEst & 123')) expect(html).to have_css '.geoblacklight-test-123' end @@ -80,11 +68,11 @@ let(:document) { SolrDocument.new(document_attributes) } before do allow_any_instance_of(Geoblacklight::Reference).to receive(:to_hash).and_return(download: 'http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip') end it 'generates a link to download the original file' do - expect(download_link_direct(text, document)).to eq '<a contentUrl="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip" class="btn btn-primary btn-block download download-original" data-download="trigger" data-download-type="direct" href="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip">Test Link Text</a>' + expect(download_link_direct(text, document)).to eq '<a contentUrl="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip" class="btn btn-default download download-original" data-download="trigger" data-download-type="direct" href="http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.TG10USAIANNH/data.zip">Test Link Text</a>' end end describe '#download_link_hgl' do let(:text) { 'Test Link Text' } @@ -94,11 +82,11 @@ allow(document).to receive(:id).and_return('test-id') allow(document).to receive(:to_s).and_return('test-id') end it 'generates a link to the HGL route' do - expect(download_link_hgl(text, document)).to eq '<a class="btn btn-primary btn-block download download-original" data-ajax-modal="trigger" data-download="trigger" data-download-type="harvard-hgl" data-download-id="test-id" href="/download/hgl/test-id">Test Link Text</a>' + expect(download_link_hgl(text, document)).to eq '<a class="btn btn-default download download-original" data-blacklight-modal="trigger" data-download="trigger" data-download-type="harvard-hgl" data-download-id="test-id" href="/download/hgl/test-id">Test Link Text</a>' end end describe '#download_link_iiif' do let(:references_field) { Settings.FIELDS.REFERENCES } @@ -115,11 +103,11 @@ allow_any_instance_of(Geoblacklight::Reference).to receive(:to_hash).and_return(iiif: 'https://example.edu/image/info.json') end it 'generates a link to download the JPG file from the IIIF server' do assign(:document, document) - expect(helper.download_link_iiif).to eq '<a contentUrl="https://example.edu/image/full/full/0/default.jpg" class="btn btn-primary btn-block download download-generated" data-download="trigger" href="https://example.edu/image/full/full/0/default.jpg">Original JPG</a>' + expect(helper.download_link_iiif).to eq '<a contentUrl="https://example.edu/image/full/full/0/default.jpg" class="btn btn-default download download-generated" data-download="trigger" href="https://example.edu/image/full/full/0/default.jpg">Original JPG</a>' end end describe '#download_link_generated' do let(:download_type) { 'SHAPEFILE' } @@ -129,11 +117,11 @@ allow(document).to receive(:id).and_return('test-id') allow(document).to receive(:to_s).and_return('test-id') end it 'generates a link to download the JPG file from the IIIF server' do - expect(download_link_generated(download_type, document)).to eq '<a class="btn btn-primary btn-block download download-generated" data-download-path="/download/test-id?type=SHAPEFILE" data-download="trigger" data-download-type="SHAPEFILE" data-download-id="test-id" href="">Export</a>' + expect(download_link_generated(download_type, document)).to eq '<a class="btn btn-default download download-generated" data-download-path="/download/test-id?type=SHAPEFILE" data-download="trigger" data-download-type="SHAPEFILE" data-download-id="test-id" href="">Export</a>' end end describe '#geoblacklight_basemap' do let(:blacklight_config) { double } @@ -215,15 +203,9 @@ context 'when CartoHelper methods are within scope' do include CartoHelper before do allow(helper).to receive(:application_name).and_return('GeoBlacklight') - end - - describe '#cartodb_provider' do - it 'aliases CartoHelper#carto_provider' do - expect(helper.cartodb_provider).to eq('GeoBlacklight') - end end describe '#cartodb_link' do it 'aliases CartoHelper#carto_link' do expect(helper.cartodb_link('http://demo.org/wfs/layer.json')).to eq(helper.carto_link('http://demo.org/wfs/layer.json'))