Sha256: 3b69e6383bba756e59a9fbd355b08bdba9428c8a273585d5d635e6049ed1498c

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

def setFilters(f)
  @filters = f
end

## These should be reworked, but attr_reader actually breaks it.
# rubocop:disable Style/TrivialAccessors
def filters
  @filters
end

describe "BlacklightAdvancedSearch::FilterParser" do
  include BlacklightAdvancedSearch::FilterParser

  describe "filter processing" do
    it "should generate an appropriate fq param" do
      setFilters(:format => %w(Book Thesis), :location => %w(Online Library))
      fq_params = generate_solr_fq
      expect(fq_params.find { |a| a =~ /format\:\((\"Book\"|\"Thesis\") +OR +(\"Thesis\"|\"Book\")/ }).not_to be_nil
      expect(fq_params.find { |a| a =~ /location\:\((\"Library\"|\"Online\") +OR +(\"Library\"|\"Online\")/ }).not_to be_nil
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight_advanced_search-7.0.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.4.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.4.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.3.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.3.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.2.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.2.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.1.0 spec/lib/filter_parser_spec.rb