Sha256: 4169e5e5b335856a78b0422591741a10310d988d954bc7c1c9f72ef12607d47d

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

describe Elastic::AppSearch::Client::Search do
  include_context 'App Search Credentials'
  include_context 'Static Test Engine'

  let(:client) { Elastic::AppSearch::Client.new(client_options) }

  context 'QuerySuggest' do
    describe '#query_suggestion' do
      let(:query) { 'cat' }
      let(:options) { { :size => 3, :types => { :documents => { :fields => ['title'] } } } }

      context 'when options are provided' do
        subject { client.query_suggestion(engine_name, query, options) }

        it 'should request query suggestions' do
          expected = {
            'meta' => anything,
            'results' => anything
          }
          expect(subject).to(match(expected))
        end
      end

      context 'when options are omitted' do
        subject { client.query_suggestion(engine_name, query) }

        it 'should request query suggestions' do
          expected = {
            'meta' => anything,
            'results' => anything
          }
          expect(subject).to(match(expected))
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
elastic-app-search-7.10.0 spec/query_suggestion_spec.rb
elastic-app-search-7.9.0 spec/query_suggestion_spec.rb
elastic-app-search-7.8.0 spec/query_suggestion_spec.rb
elastic-app-search-7.7.0 spec/query_suggestion_spec.rb
elastic-app-search-7.6.0 spec/query_suggestion_spec.rb
elastic-app-search-7.5.0 spec/query_suggestion_spec.rb
elastic-app-search-7.4.1 spec/query_suggestion_spec.rb