spec/elasticsearch/api/actions/search_spec.rb in elasticsearch-api-8.10.0 vs spec/elasticsearch/api/actions/search_spec.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -22,11 +22,12 @@
[
method,
url,
params,
body,
- {}
+ {},
+ { endpoint: 'search' }
]
end
let(:method) { 'GET' }
let(:body) do
@@ -63,17 +64,39 @@
context 'when an index is specified' do
let(:url) do
'foo/_search'
end
+ let(:expected_args) do
+ [
+ method,
+ url,
+ params,
+ body,
+ {},
+ { defined_params: { index: 'foo' }, endpoint: 'search' }
+ ]
+ end
+
it 'performs the request' do
expect(client_double.search(index: 'foo'))
end
end
context 'when multiple indices are specified' do
let(:url) do
'foo,bar/_search'
+ end
+
+ let(:expected_args) do
+ [
+ method,
+ url,
+ params,
+ body,
+ {},
+ { defined_params: { index: ['foo', 'bar'] }, endpoint: 'search' }
+ ]
end
it 'performs the request' do
expect(client_double.search(index: ['foo', 'bar']))
end