Skip to content

Commit bed0798

Browse files
committed
[API] Updates resolve cluster spec
1 parent 20f902b commit bed0798

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

elasticsearch-api/spec/elasticsearch/api/actions/indices/resolve_cluster_spec.rb

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,38 @@
1717

1818
require 'spec_helper'
1919

20-
describe 'client.indices#delete_alias' do
21-
20+
describe 'client.indices#resolve_cluster' do
2221
let(:expected_args) do
2322
[
2423
'GET',
25-
'_resolve/cluster/foo',
24+
path,
2625
{},
2726
nil,
2827
{},
29-
{ defined_params: { name: 'foo'}, endpoint: 'indices.resolve_cluster' }
28+
otel
3029
]
3130
end
3231

3332
context 'when there is no name specified' do
3433
let(:client) do
3534
Class.new { include Elasticsearch::API }.new
3635
end
36+
let(:path) { '_resolve/cluster' }
37+
let(:otel) do
38+
{ endpoint: 'indices.resolve_cluster' }
39+
end
3740

38-
it 'raises an exception' do
39-
expect {
40-
client.indices.resolve_cluster
41-
}.to raise_exception(ArgumentError)
41+
it 'performs the request' do
42+
expect(client_double.indices.resolve_cluster).to be_a Elasticsearch::API::Response
4243
end
4344
end
4445

45-
4646
context 'when name is specified' do
47+
let(:path) { '_resolve/cluster/foo' }
48+
let(:otel) do
49+
{ defined_params: { name: 'foo' }, endpoint: 'indices.resolve_cluster' }
50+
end
51+
4752
it 'performs the request' do
4853
expect(client_double.indices.resolve_cluster(name: 'foo')).to be_a Elasticsearch::API::Response
4954
end

0 commit comments

Comments
 (0)