Skip to content

Commit 6e94ef2

Browse files
committed
[API] Updates API unit tests
1 parent 0f9f644 commit 6e94ef2

File tree

169 files changed

+348
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+348
-366
lines changed

elasticsearch-api/spec/elasticsearch/api/actions/bulk_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
{ :update => { :_index => 'myindexB', :_type => 'mytype', :_id => '2', :data => { :doc => { :title => 'Update' } } } },
5555
{ :delete => { :_index => 'myindexC', :_type => 'mytypeC', :_id => '3' } },
5656
{ :index => { :_index => 'myindexD', :_type => 'mytype', :_id => '1', :data => { :data => 'MYDATA' } } },
57-
])).to eq({})
57+
])).to be_a Elasticsearch::API::Response
5858
end
5959
end
6060

@@ -63,7 +63,7 @@
6363
let(:url) { 'myindex/_bulk' }
6464

6565
it 'performs the request' do
66-
expect(client_double.bulk(index: 'myindex', body: [])).to eq({})
66+
expect(client_double.bulk(index: 'myindex', body: [])).to be_a Elasticsearch::API::Response
6767
end
6868
end
6969

@@ -78,7 +78,7 @@
7878

7979
it 'performs the request' do
8080
expect(client_double.bulk(body:[ { :update => { :_index => 'myindex', :_type => 'mytype', :_id => '1' } },
81-
{ :doc => { :data => { :title => 'Update' } } } ])).to eq({})
81+
{ :doc => { :data => { :title => 'Update' } } } ])).to be_a Elasticsearch::API::Response
8282
end
8383
end
8484

@@ -89,7 +89,7 @@
8989
end
9090

9191
it 'performs the request' do
92-
expect(client_double.bulk(body: 'foo\nbar')).to eq({})
92+
expect(client_double.bulk(body: 'foo\nbar')).to be_a Elasticsearch::API::Response
9393
end
9494
end
9595

@@ -100,7 +100,7 @@
100100
end
101101

102102
it 'performs the request' do
103-
expect(client_double.bulk(body: ['foo', 'bar'])).to eq({})
103+
expect(client_double.bulk(body: ['foo', 'bar'])).to be_a Elasticsearch::API::Response
104104
end
105105
end
106106

@@ -111,7 +111,7 @@
111111
end
112112

113113
it 'performs the request' do
114-
expect(client_double.bulk(refresh: true, body: [])).to eq({})
114+
expect(client_double.bulk(refresh: true, body: [])).to be_a Elasticsearch::API::Response
115115
end
116116
end
117117

@@ -122,7 +122,7 @@
122122
end
123123

124124
it 'performs the request' do
125-
expect(client_double.bulk(index: 'foo^bar', body: [])).to eq({})
125+
expect(client_double.bulk(index: 'foo^bar', body: [])).to be_a Elasticsearch::API::Response
126126
end
127127
end
128128

@@ -133,7 +133,7 @@
133133
end
134134

135135
it 'performs the request' do
136-
expect(client_double.bulk(index: 'myindex', type: 'mytype', body: [])).to eq({})
136+
expect(client_double.bulk(index: 'myindex', type: 'mytype', body: [])).to be_a Elasticsearch::API::Response
137137
end
138138
end
139139
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/aliases_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.aliases).to eq({})
33+
expect(client_double.cat.aliases).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/allocation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.allocation).to eq({})
33+
expect(client_double.cat.allocation).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/count_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.count).to eq({})
33+
expect(client_double.cat.count).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/fielddata_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.fielddata).to eq({})
33+
expect(client_double.cat.fielddata).to be_a Elasticsearch::API::Response
3434
end
3535

3636
context 'when field are specified' do
@@ -46,7 +46,7 @@
4646
end
4747

4848
it 'performs the request' do
49-
expect(client_double.cat.fielddata(fields: ['foo', 'bar'])).to eq({})
49+
expect(client_double.cat.fielddata(fields: ['foo', 'bar'])).to be_a Elasticsearch::API::Response
5050
end
5151
end
5252
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/health_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.health).to eq({})
33+
expect(client_double.cat.health).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/help_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.help).to eq({})
33+
expect(client_double.cat.help).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/indices_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.indices).to eq({})
33+
expect(client_double.cat.indices).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/master_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.master).to eq({})
33+
expect(client_double.cat.master).to be_a Elasticsearch::API::Response
3434
end
3535
end

elasticsearch-api/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
end
3131

3232
it 'performs the request' do
33-
expect(client_double.cat.nodeattrs).to eq({})
33+
expect(client_double.cat.nodeattrs).to be_a Elasticsearch::API::Response
3434
end
3535
end

0 commit comments

Comments
 (0)