Sha256: 782a12c52414df9b51a9aeeb54d7d1110ab234c58a124b2ed39e958780304205

Contents?: true

Size: 1.23 KB

Versions: 19

Compression:

Stored size: 1.23 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.indices#clear_cache' do

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

  let(:url) do
    '_cache/clear'
  end

  let(:params) do
    {}
  end

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

  context 'when an index is specified' do

    let(:url) do
      'foo/_cache/clear'
    end

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

  context 'when params are specified' do

    let(:params) do
      { fielddata: true }
    end

    it 'performs the request' do
      expect(client_double.indices.clear_cache(fielddata: true)).to eq({})
    end
  end

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

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

    let(:params) do
      { }
    end

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
elasticsearch-api-7.13.3 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.13.1 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.13.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.13.0.pre spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.12.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.11.2 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.11.1 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.11.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.11.0.pre.1 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.10.1 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.10.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.10.0.pre spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.9.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.8.1 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.9.0.pre spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.8.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.8.0.pre spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.7.0 spec/elasticsearch/api/actions/indices/clear_cache_spec.rb
elasticsearch-api-7.7.0.pre spec/elasticsearch/api/actions/indices/clear_cache_spec.rb