Sha256: d4545cc03485f9700a457f8928dff761fa7ecc09cfba3ae933d5a40bec6fbdf9

Contents?: true

Size: 582 Bytes

Versions: 39

Compression:

Stored size: 582 Bytes

Contents

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

describe 'query DSL', :type => :query do
  it 'should allow building search using block argument rather than instance_eval' do
    @blog_id = 1
    session.search Post do |query|
      query.with(:blog_id, @blog_id)
    end
    connection.should have_last_search_including(:fq, 'blog_id_i:1')
  end

  it 'should accept a block in the #new_search method' do
    search = session.new_search(Post) { with(:blog_id, 1) }
    search.execute
    connection.should have_last_search_including(:fq, 'blog_id_i:1')
  end
end

Version data entries

39 entries across 39 versions & 9 rubygems

Version Path
sunspot-2.2.5 spec/api/query/dsl_spec.rb
sunspot-2.2.4 spec/api/query/dsl_spec.rb
sunspot-2.2.3 spec/api/query/dsl_spec.rb
sunspot-2.2.2 spec/api/query/dsl_spec.rb
sunspot-2.2.1 spec/api/query/dsl_spec.rb
sunspot-2.2.0 spec/api/query/dsl_spec.rb
sunspot-2.1.1 spec/api/query/dsl_spec.rb
sunspot-2.1.0 spec/api/query/dsl_spec.rb
sunspot-2.0.0 spec/api/query/dsl_spec.rb
sunspot-2.0.0.pre.130115 spec/api/query/dsl_spec.rb
gojee-sunspot-2.0.5 spec/api/query/dsl_spec.rb
sunspot-2.0.0.pre.120925 spec/api/query/dsl_spec.rb
sunspot_solr-2.0.0.pre.120924 sunspot/spec/api/query/dsl_spec.rb
sunspot_rails-2.0.0.pre.120924 sunspot/spec/api/query/dsl_spec.rb
sunspot-2.0.0.pre.120924 sunspot/spec/api/query/dsl_spec.rb
gojee-sunspot-2.0.4 spec/api/query/dsl_spec.rb
gojee-sunspot-2.0.2 spec/api/query/dsl_spec.rb
sunspot-2.0.0.pre.120720 spec/api/query/dsl_spec.rb
sunspot-1.3.3 spec/api/query/dsl_spec.rb
sunspot-1.3.2 spec/api/query/dsl_spec.rb