Sha256: 20def984806fbc6a1773d3520f7ea63c883bc288e7adbaf448aa9e27478fcec1

Contents?: true

Size: 1.26 KB

Versions: 12

Compression:

Stored size: 1.26 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
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
geoblacklight-0.9.2 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.9.1 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.9.0 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.8.0 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.7.1 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.7.0 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.6.2 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.6.1 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.6.0 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.5.1 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.5.0 spec/helpers/geoblacklight_helpers_spec.rb
geoblacklight-0.4.2 spec/helpers/geoblacklight_helpers_spec.rb