Sha256: 3d36bd274b71fefb2ecc0403bfeb0240714fbc5d4be5129364e2cbc6e5bcd24b

Contents?: true

Size: 854 Bytes

Versions: 6

Compression:

Stored size: 854 Bytes

Contents

describe Sufia::MySharesSearchBuilder do
  let(:me) { create(:user) }
  let(:config) { CatalogController.blacklight_config }
  let(:scope) { double('The scope',
                       blacklight_config: config,
                       params: {},
                       current_ability: Ability.new(me),
                       current_user: me) }
  let(:builder) { described_class.new(scope) }

  before { allow(builder).to receive(:gated_discovery_filters).and_return(["access_filter1", "access_filter2"]) }

  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,Collection",
                           "-_query_:\"{!field f=depositor_ssim}#{me.email}\""]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-7.1.0 spec/search_builder/sufia/my_shares_search_builder_spec.rb
sufia-7.0.0 spec/search_builder/sufia/my_shares_search_builder_spec.rb
sufia-7.0.0.rc2 spec/search_builder/sufia/my_shares_search_builder_spec.rb
sufia-7.0.0.rc1 spec/search_builder/sufia/my_shares_search_builder_spec.rb
sufia-7.0.0.beta4 spec/search_builder/sufia/my_shares_search_builder_spec.rb
sufia-7.0.0.beta3 spec/search_builder/sufia/my_shares_search_builder_spec.rb