Sha256: c54b64d98467737bb78d108e2cf325e2455ce909839eadc356cb981e3f8cde31

Contents?: true

Size: 1.1 KB

Versions: 22

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

describe ApplicationController, type: :controller do
  routes { Spotlight::Engine.routes }
  let(:exhibit) { FactoryBot.create(:exhibit) }

  it { is_expected.to be_a_kind_of Spotlight::Controller }

  describe 'exhibit-specific routing' do
    context 'with a current exhibit' do
      before do
        allow(controller).to receive(:current_exhibit).and_return(exhibit)
      end

      describe '#search_action_url' do
        it 'is a path within the current exhibit' do
          expected = { controller: 'spotlight/catalog', action: 'index', exhibit_id: exhibit.slug }
          expect(get: controller.search_action_url(only_path: true).gsub('/spotlight', '')).to route_to expected
        end
      end

      describe '#search_facet_path' do
        it 'is a path within the current exhibit' do
          expected = { controller: 'spotlight/catalog', action: 'facet', id: 'some-facet', exhibit_id: exhibit.slug }
          expect(get: controller.search_facet_path(id: 'some-facet', only_path: true).gsub('/spotlight', '')).to route_to expected
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.3.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.2.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.1.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.3 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.2 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/controllers/application_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/controllers/application_controller_spec.rb