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