Sha256: c69842533d7d4526d2e1d6626a2e4116be5a31b464004f5b7d9483909e05ab1c

Contents?: true

Size: 1.45 KB

Versions: 8

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true
require 'spec_helper'

feature 'wmts layer' do
  before do
    WebMock.disable_net_connect!(allow_localhost: true, allow: 'chromedriver.storage.googleapis.com')
  end

  after do
    WebMock.allow_net_connect!
  end

  context 'when referencing a WMTSCapabilities document with a single layer' do
    scenario 'displays the layer', js: true do
      # Mock wmts manifest url
      stub_request(:get, 'https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248')
        .to_return(status: 200, body: read_fixture('manifests/wmts-single.xml'))

      visit solr_document_path('princeton-fk4544658v-wmts')
      expect(page).to have_css '.leaflet-control-zoom', visible: :visible
      expect(page).to have_css "img[src*='map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad']"
    end
  end
  context 'when referencing a WMTSCapabilities document with a multiple layers' do
    scenario 'displays the layer referenced in the layer_id field', js: true do
      # Mock wmts manifest url
      stub_request(:get, 'https://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml')
        .to_return(status: 200, body: read_fixture('manifests/wmts-multiple.xml'))
      visit solr_document_path('princeton-fk4db9hn29')
      expect(page).to have_css '.leaflet-control-zoom', visible: :visible
      expect(page).to have_css "img[src*='http://maps1.wien.gv.at/wmts/lb2016/farbe/google3857']"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geoblacklight-3.8.1 spec/features/wmts_spec.rb
geoblacklight-3.8.0 spec/features/wmts_spec.rb
geoblacklight-4.0.0 spec/features/wmts_spec.rb
geoblacklight-4.0.0.pre.rc3 spec/features/wmts_spec.rb
geoblacklight-3.7.0 spec/features/wmts_spec.rb
geoblacklight-4.0.0.pre.rc2 spec/features/wmts_spec.rb
geoblacklight-4.0.0.pre.rc1 spec/features/wmts_spec.rb
geoblacklight-3.6.0 spec/features/wmts_spec.rb