Sha256: 023c95b3a0245a537ceede6ef062f90177849b14a08528e6e2003aea8aaeee22

Contents?: true

Size: 1.03 KB

Versions: 41

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper' 
describe Blacklight::Routes do
  subject { Blacklight::Routes.new(router, options) }
  let(:router) { double }

  describe "solr_document" do
    describe "without constraints" do
      let(:options) { Hash.new }
      it "should define the resources" do
        allow(router).to receive(:resources).with(:solr_document, {:path=>:records, :controller=>:records, :only=>[:show]})
        allow(router).to receive(:resources).with(:records, :only=>[:show])
        subject.solr_document(:records)
      end
    end

    describe "with constraints" do
      let(:options) { { :constraints => {id: /[a-z]+/, format: false } } }
      it "should define the resources" do
        allow(router).to receive(:resources).with(:solr_document, {:path=>:records, :controller=>:records, :only=>[:show], :constraints=>{:id=>/[a-z]+/, :format=>false} })
        allow(router).to receive(:resources).with(:records, :only=>[:show], :constraints=>{:id=>/[a-z]+/, :format=>false})
        subject.solr_document(:records)
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/lib/blacklight/routes_spec.rb
blacklight-5.19.1 spec/lib/blacklight/routes_spec.rb
blacklight-5.19.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.18.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.17.2 spec/lib/blacklight/routes_spec.rb
blacklight-5.17.1 spec/lib/blacklight/routes_spec.rb
blacklight-5.17.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.16.4 spec/lib/blacklight/routes_spec.rb
blacklight-5.16.3 spec/lib/blacklight/routes_spec.rb
blacklight-5.16.2 spec/lib/blacklight/routes_spec.rb
blacklight-5.16.1 spec/lib/blacklight/routes_spec.rb
blacklight-5.16.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.15.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.14.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.13.1 spec/lib/blacklight/routes_spec.rb
blacklight-5.13.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.11.3 spec/lib/blacklight/routes_spec.rb
blacklight-5.12.1 spec/lib/blacklight/routes_spec.rb
blacklight-5.12.0 spec/lib/blacklight/routes_spec.rb
blacklight-5.10.3 spec/lib/blacklight/routes_spec.rb