Sha256: 6e989071c6562014309ccbfc912e46a119904abab785bad2073fa9bb6a6ab7c3

Contents?: true

Size: 707 Bytes

Versions: 23

Compression:

Stored size: 707 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

      fq_params.find {|a| a =~ /format\:\((\"Book\"|\"Thesis\") +OR +(\"Thesis\"|\"Book\")/}.should_not be_nil

      fq_params.find {|a| a =~ /location\:\((\"Library\"|\"Online\") +OR +(\"Library\"|\"Online\")/}.should_not be_nil
      

    end    
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
blacklight_advanced_search-5.1.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.1.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.0.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-5.0.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-2.2.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-2.1.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-2.1.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-2.1.0.rc1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-2.0.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.2.4 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.2.3 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.2.2 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.2.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.2.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.1.2 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.1.1 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.1.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.0.0 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.0.0pre5 spec/lib/filter_parser_spec.rb
blacklight_advanced_search-1.0.0pre4 spec/lib/filter_parser_spec.rb