Sha256: 61e634bdff81dd5a2efdd1d779a6c1d08015cdd4e9cf419b1fcf6f3df8670985

Contents?: true

Size: 799 Bytes

Versions: 39

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::FileSetSearchBuilder do
  let(:processor_chain) { [:filter_models] }
  let(:ability) { double('ability') }
  let(:context) { double('context') }
  let(:user) { double('user') }
  let(:solr_params) { { fq: [] } }

  subject { described_class.new(context) }
  describe '#filter_models' do
    before { subject.filter_models(solr_params) }

    it 'adds FileSet to query' do
      expect(solr_params[:fq].first).to include('{!field f=has_model_ssim}FileSet')
    end
  end

  describe '#find_one' do
    before do
      allow(subject).to receive(:blacklight_params).and_return(id: '12345')
      subject.find_one(solr_params)
    end

    it 'adds id to query' do
      expect(solr_params[:fq].first).to include('{!field f=id}12345')
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
curation_concerns-1.5.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.4.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.3.3 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.3.2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.3.1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.3.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.2.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.1.2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.1.1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.1.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta10 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta9 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta8 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta7 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta6 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta5 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta4 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta3 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.0.0.beta2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb