Sha256: 9c5c104eaa850e9a3ee4ad3db65b7e53211e5d7d2f1513d6d170c78c83cb5174

Contents?: true

Size: 1.09 KB

Versions: 27

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe ApplicationController, type: :controller do
  routes { Spotlight::Engine.routes }
  let(:exhibit) { FactoryGirl.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_facets_url' 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_url(id: 'some-facet', only_path: true).gsub('/spotlight', '')).to route_to expected
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
blacklight-spotlight-0.18.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.17.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.17.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.16.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.15.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.14.2 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.14.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.14.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.13.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.12.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.12.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.11.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.10.3 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.10.2 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.10.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.10.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.9.2 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.9.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.9.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.8.2 spec/controllers/application_controller_spec.rb