Sha256: 08758dd798d858f01f5ce2d89aac7906d253f2babe1147155910f08e13eb064c

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 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 "should be a path within the current exhibit" do
          expect(get: controller.search_action_url(only_path: true).gsub("/spotlight", "")).to route_to controller: "spotlight/catalog", action: "index", exhibit_id: exhibit.slug
        end
      end

      describe "#search_facets_url" do
        it "should be a path within the current exhibit" do
          expect(get: controller.search_facet_url(id: "some-facet", only_path: true).gsub("/spotlight", "")).to route_to controller: "spotlight/catalog", action: "facet", id:"some-facet", exhibit_id: exhibit.slug
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blacklight-spotlight-0.4.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.3.1 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.3.0 spec/controllers/application_controller_spec.rb
blacklight-spotlight-0.2.0 spec/controllers/application_controller_spec.rb