# Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information require 'spec_helper' describe 'client.indices#analyze' do let(:expected_args) do [ 'GET', url, params, body, {} ] end let(:body) do nil end let(:url) do '_analyze' end let(:params) do {} end it 'performs the request' do expect(client_double.indices.analyze).to eq({}) end context 'when an index is specified' do let(:url) do 'foo/_analyze' end it 'performs the request' do expect(client_double.indices.analyze(index: 'foo')).to eq({}) end end context 'when a body is specified' do let(:body) do 'foo' end it 'performs the request' do expect(client_double.indices.analyze(body: 'foo')).to eq({}) end end end