Sha256: a6763b32cdc7e25145b011fd14569f99f82c3664638d1f82a7f8c33e7cdf9219
Contents?: true
Size: 1.01 KB
Versions: 7
Compression:
Stored size: 1.01 KB
Contents
describe Sufia::MySharesSearchBuilder do let(:me) { create(:user) } let(:config) { CatalogController.blacklight_config } let(:scope) do double('The scope', blacklight_config: config, params: {}, current_ability: Ability.new(me), current_user: me) end let(:builder) { described_class.new(scope) } let(:solr_params) { { q: user_query } } before do allow(builder).to receive(:gated_discovery_filters).and_return(["access_filter1", "access_filter2"]) allow(ActiveFedora::SolrQueryBuilder).to receive(:construct_query_for_rel) .with(depositor: me.user_key) .and_return("depositor") end subject { builder.to_hash['fq'] } it "filters things we have access to in which we are not the depositor" do expect(subject).to eq ["access_filter1 OR access_filter2", "{!terms f=has_model_ssim}GenericWork,Atlas,Collection", "-suppressed_bsi:true", "-depositor"] end end
Version data entries
7 entries across 7 versions & 1 rubygems