Sha256: a690f6218d9db8085be5b303d973cbb5b852f5c6749d521f8db5b1a574a92088

Contents?: true

Size: 993 Bytes

Versions: 8

Compression:

Stored size: 993 Bytes

Contents

# 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#open' do

  let(:expected_args) do
    [
        'POST',
        url,
        params,
        nil,
        nil
    ]
  end

  let(:params) do
    {}
  end

  let(:url) do
    'foo/_open'
  end

  it 'performs the request' do
    expect(client_double.indices.open(index: 'foo')).to eq({})
  end

  context 'when parameters are specified' do

    let(:params) do
      { timeout: '1s' }
    end

    it 'performs the request' do
      expect(client_double.indices.open(index: 'foo', timeout: '1s')).to eq({})
    end
  end

  context 'when the path must be URL-escaped' do

    let(:url) do
      'foo%5Ebar/_open'
    end

    it 'performs the request' do
      expect(client_double.indices.open(index: 'foo^bar')).to eq({})
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
elasticsearch-api-6.8.3 spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-6.8.2 spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.6.0 spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.6.0.pre spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.5.0 spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.5.0.pre.pre spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.4.0 spec/elasticsearch/api/actions/indices/open_spec.rb
elasticsearch-api-7.3.0 spec/elasticsearch/api/actions/indices/open_spec.rb