Sha256: 8b9640d56e21afffce84f6f3c7e727f57a88bf79857b5e432dbd29668baca567

Contents?: true

Size: 715 Bytes

Versions: 10

Compression:

Stored size: 715 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

def setFilters(f)
  @filters = f
end

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 => ["Book", "Thesis"], :location=>["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

10 entries across 10 versions & 1 rubygems

Version Path
blacklight_advanced_search-5.3.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.3.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.0.2 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.0.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-6.0.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.2.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.2.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.1.4 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.1.3 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.1.2 spec/lib/filter_parser_spec.rb