Sha256: 013262470021458664ff85c2558bf2a72bc7126f01f5adf4e682b72f77909123

Contents?: true

Size: 1.16 KB

Versions: 8

Compression:

Stored size: 1.16 KB

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.cluster#get_settings' do

  let(:expected_args) do
    [
        'GET',
        url,
        {},
        nil,
        nil
    ]
  end

  let(:url) do
    '_settings'
  end

  it 'performs the request' do
    expect(client_double.indices.get_settings).to eq({})
  end

  context 'when an index is specified' do

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

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

  context 'when a name is specified' do

    let(:url) do
      'foo/_settings/foo.bar'
    end

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

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

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

    it 'performs the request' do
      expect(client_double.indices.get_settings(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/get_settings_spec.rb
elasticsearch-api-6.8.2 spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.6.0 spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.6.0.pre spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.5.0 spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.5.0.pre.pre spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.4.0 spec/elasticsearch/api/actions/indices/get_settings_spec.rb
elasticsearch-api-7.3.0 spec/elasticsearch/api/actions/indices/get_settings_spec.rb