Sha256: eda013da32ebcdaee38df5eba56268922b1aab763623584f0cd82252b2f7e580

Contents?: true

Size: 797 Bytes

Versions: 17

Compression:

Stored size: 797 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('{!terms 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('{!raw f=id}12345')
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.7 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-2.0.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-2.0.0.rc2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.6 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.5 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.4 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.3 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-2.0.0.rc1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.7.0.beta1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.6.3 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.6.2 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.6.1 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb
curation_concerns-1.6.0 spec/search_builders/curation_concerns/file_set_search_builder_spec.rb