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

- old
+ new

@@ -40,43 +40,40 @@ let(:params) do {} end it 'performs the request' do - expect(client_double.indices.stats).to eq({}) + expect(client_double.indices.stats).to be_a Elasticsearch::API::Response end context 'when an index is specified' do - let(:url) do 'foo/_stats' end it 'performs the request' do - expect(client_double.indices.stats(index: 'foo')).to eq({}) + expect(client_double.indices.stats(index: 'foo')).to be_a Elasticsearch::API::Response end end context 'when multiple indicies are specified as a list' do - let(:url) do 'foo,bar/_stats' end it 'performs the request' do - expect(client_double.indices.stats(index: ['foo', 'bar'])).to eq({}) + expect(client_double.indices.stats(index: ['foo', 'bar'])).to be_a Elasticsearch::API::Response end end context 'when multiple indicies are specified as a string' do - let(:url) do 'foo,bar/_stats' end it 'performs the request' do - expect(client_double.indices.stats(index: 'foo,bar')).to eq({}) + expect(client_double.indices.stats(index: 'foo,bar')).to be_a Elasticsearch::API::Response end end context 'when parameters are specified' do let(:params) do @@ -86,39 +83,37 @@ let(:url) do 'foo/_stats' end it 'performs the request' do - expect(client_double.indices.stats(index: 'foo', expand_wildcards: true)).to eq({}) + expect(client_double.indices.stats(index: 'foo', expand_wildcards: true)).to be_a Elasticsearch::API::Response end end context 'when the fields parameter is specified as a list' do - let(:params) do { fields: 'foo,bar' } end let(:url) do 'foo/_stats/fielddata' end it 'performs the request' do - expect(client_double.indices.stats(index: 'foo', fielddata: true, fields: [ 'foo', 'bar'])).to eq({}) + expect(client_double.indices.stats(index: 'foo', metric: 'fielddata', fields: ['foo', 'bar'])).to be_a Elasticsearch::API::Response end end context 'when the groups parameter is specified as a list' do - let(:params) do { groups: 'groupA,groupB' } end let(:url) do '_stats/search' end it 'performs the request' do - expect(client_double.indices.stats(search: true, groups: [ 'groupA', 'groupB'])).to eq({}) + expect(client_double.indices.stats(groups: [ 'groupA', 'groupB'], metric: 'search')).to be_a Elasticsearch::API::Response end end end