Sha256: 670756fef42fb4c5362850cfbf2720761cdc8ac1759a76f7a880f5daf2c72744

Contents?: true

Size: 846 Bytes

Versions: 42

Compression:

Stored size: 846 Bytes

Contents

require File.expand_path('spec_helper', File.dirname(__FILE__))

shared_examples_for "query with advanced manipulation" do
  describe 'adjust_solr_params' do
    before :each do
      search do
        adjust_solr_params do |params|
          params[:rows] = 40
          params[:qt] = 'complicated'
        end
      end
    end

    it "modifies existing param" do
      connection.should have_last_search_with(:rows  => 40)
    end

    it "adds new param" do
      connection.should have_last_search_with(:qt => 'complicated')
    end
  end

  describe 'request_handler' do
    before :each do
      connection.expected_handler = :myRequestHandler
      search do
        request_handler :myRequestHandler
      end
    end

    it 'should use specified request handler' do
      connection.should have_last_search_with({})
    end
  end
end

Version data entries

42 entries across 42 versions & 10 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.7 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.6 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.5 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.4 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.3 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.2 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.1 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.2.0 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.1.1 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.1.0 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.0.0 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.0.0.pre.130115 spec/api/query/advanced_manipulation_examples.rb
gojee-sunspot-2.0.5 spec/api/query/advanced_manipulation_examples.rb
sunspot-2.0.0.pre.120925 spec/api/query/advanced_manipulation_examples.rb
sunspot_solr-2.0.0.pre.120924 sunspot/spec/api/query/advanced_manipulation_examples.rb
sunspot_rails-2.0.0.pre.120924 sunspot/spec/api/query/advanced_manipulation_examples.rb
sunspot-2.0.0.pre.120924 sunspot/spec/api/query/advanced_manipulation_examples.rb
gojee-sunspot-2.0.4 spec/api/query/advanced_manipulation_examples.rb
gojee-sunspot-2.0.2 spec/api/query/advanced_manipulation_examples.rb