Sha256: c4fc663de3bd75b60f55db5a5e0f6522c241778006325313f90d77baa4a1dbf0

Contents?: true

Size: 655 Bytes

Versions: 3

Compression:

Stored size: 655 Bytes

Contents

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

describe 'join' do
  it 'should search by join' do
    session.search PhotoContainer do
      with(:caption, 'blah')
    end
    expect(connection).to have_last_search_including(
      :fq, "{!join from=photo_container_id_i to=id_i v='type:\"Photo\" AND caption_s:\"blah\"'}")
  end

  it 'should greater_than search by join' do
    session.search PhotoContainer do
      with(:photo_rating).greater_than(3)
    end
    expect(connection).to have_last_search_including(
      :fq, "{!join from=photo_container_id_i to=id_i v='type:\"Photo\" AND average_rating_ft:{3\\.0 TO *}'}")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sunspot-2.7.1 spec/api/query/join_spec.rb
sunspot-2.7.0 spec/api/query/join_spec.rb
sunspot-2.6.0 spec/api/query/join_spec.rb