Sha256: 19b5b81d340352a0ba7851b09381891828842998d07a19d106ebe8c493de9fd0

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

RSpec.describe 'Catalog controller', type: :routing do
  describe 'routing' do
    routes { Spotlight::Engine.routes }

    context 'when the routing constraint is set to allow periods' do
      before do
        allow(Blacklight::Engine.config.routes).to receive(:identifier_constraint).and_return(%r{[^/]+})
        Rails.application.reload_routes!
      end

      it 'routes to #show' do
        expect(get('/1/catalog/gallica.bnf.fr')).to route_to('spotlight/catalog#show', exhibit_id: '1', id: 'gallica.bnf.fr')
      end
    end

    it 'routes to #show with a format' do
      expect(get('/1/catalog/dq287tq6352.xml')).to route_to('spotlight/catalog#show', exhibit_id: '1', id: 'dq287tq6352', format: 'xml')
    end

    it 'routes to #edit' do
      expect(get('/1/catalog/dq287tq6352/edit')).to route_to('spotlight/catalog#edit', exhibit_id: '1', id: 'dq287tq6352')
    end

    it 'routes to #manifest' do
      expect(get('/1/catalog/1-1/manifest.json')).to route_to('spotlight/catalog#manifest', exhibit_id: '1', id: '1-1', format: 'json')
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
blacklight-spotlight-2.13.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.12.1 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.12.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.11.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.10.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.9.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.8.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.7.2 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.7.1 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.7.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.6.1.1 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.6.1 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.6.0 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.5.2 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.5.1 spec/routing/spotlight/exhibit_catalog_spec.rb
blacklight-spotlight-2.5.0 spec/routing/spotlight/exhibit_catalog_spec.rb