spec/elasticsearch/api/actions/count_spec.rb in elasticsearch-api-7.17.11 vs spec/elasticsearch/api/actions/count_spec.rb in elasticsearch-api-8.0.0.pre1

- old
+ new

@@ -16,41 +16,44 @@ # under the License. require 'spec_helper' describe 'client#count' do + let(:expected_args) do [ - 'GET', + 'POST', '_count', {}, nil, {} ] end it 'performs the request' do - expect(client_double.count).to eq({}) + expect(client_double.count).to be_a Elasticsearch::API::Response end context 'when an index and type are specified' do + let(:expected_args) do [ - 'GET', - 'foo,bar/t1,t2/_count', + 'POST', + 'foo,bar/_count', {}, nil, {} ] end it 'performs the request' do - expect(client_double.count(index: ['foo','bar'], type: ['t1','t2'])).to eq({}) + expect(client_double.count(index: ['foo','bar'])).to be_a Elasticsearch::API::Response end end context 'when there is a query provided' do + let(:expected_args) do [ 'POST', '_count', {}, @@ -58,9 +61,9 @@ {} ] end it 'performs the request' do - expect(client_double.count(body: { match: { foo: 'bar' } })).to eq({}) + expect(client_double.count(body: { match: { foo: 'bar' } })).to be_a Elasticsearch::API::Response end end end