Skip to content

Commit

Permalink
[API] Updates resolve cluster spec
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Feb 3, 2025
1 parent 20f902b commit bed0798
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,38 @@

require 'spec_helper'

describe 'client.indices#delete_alias' do

describe 'client.indices#resolve_cluster' do
let(:expected_args) do
[
'GET',
'_resolve/cluster/foo',
path,
{},
nil,
{},
{ defined_params: { name: 'foo'}, endpoint: 'indices.resolve_cluster' }
otel
]
end

context 'when there is no name specified' do
let(:client) do
Class.new { include Elasticsearch::API }.new
end
let(:path) { '_resolve/cluster' }
let(:otel) do
{ endpoint: 'indices.resolve_cluster' }
end

it 'raises an exception' do
expect {
client.indices.resolve_cluster
}.to raise_exception(ArgumentError)
it 'performs the request' do
expect(client_double.indices.resolve_cluster).to be_a Elasticsearch::API::Response
end
end


context 'when name is specified' do
let(:path) { '_resolve/cluster/foo' }
let(:otel) do
{ defined_params: { name: 'foo' }, endpoint: 'indices.resolve_cluster' }
end

it 'performs the request' do
expect(client_double.indices.resolve_cluster(name: 'foo')).to be_a Elasticsearch::API::Response
end
Expand Down

0 comments on commit bed0798

Please sign in to comment.