Sha256: 26b30df6c5de0171f47b20c472b130ec28f54a14713147ea087d9a24e6ff1881

Contents?: true

Size: 831 Bytes

Versions: 18

Compression:

Stored size: 831 Bytes

Contents

describe 'scoping with text fields', :type => :query do
  it 'should scope with a text field' do
    session.search(Post) do
      text_fields do
        with(:body, 'test')
      end
    end
    connection.should have_last_search_including(:fq, 'body_texts:test')
  end

  it 'should raise an UnrecognizedFieldError if differently configured text field is used' do
    lambda do
      session.search(Post, Namespaced::Comment) do
        text_fields do
          with(:body, 'test')
        end
      end
    end.should raise_error(Sunspot::UnrecognizedFieldError)
  end

  it 'should raise an UnrecognizedFieldError if no field exists' do
    lambda do
      session.search(Post) do
        text_fields do
          with(:bogus, 'test')
        end
      end
    end.should raise_error(Sunspot::UnrecognizedFieldError)
  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
sunspot-1.0.5 spec/api/query/text_field_scoping_spec.rb
sunspot-1.0.4 spec/api/query/text_field_scoping_spec.rb
sunspot-1.0.3 spec/api/query/text_field_scoping_spec.rb
sunspot-1.0.2 spec/api/query/text_field_scoping_spec.rb
sunspot-1.0.1 spec/api/query/text_field_scoping_spec.rb
sunspot-1.0.0 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.9 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.8 spec/api/query/text_field_scoping_spec.rb
nxa-sunspot-0.10.7 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.7 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.6 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.5 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.4 spec/api/query/text_field_scoping_spec.rb
kuahyeow-sunspot-0.10.3 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.3 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.2 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.1 spec/api/query/text_field_scoping_spec.rb
sunspot-0.10.0 spec/api/query/text_field_scoping_spec.rb