Skip to content

Commit 3534050

Browse files
committed
[CLIENT] Update test descriptions for compression settings
1 parent a58ade6 commit 3534050

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

elasticsearch-transport/spec/elasticsearch/transport/client_spec.rb

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@
12391239
end
12401240
end
12411241

1242-
context 'when \'transport_options\' are defined with \'accept_encoding\' specified' do
1242+
context 'when the \'compression\' option is set to true' do
12431243

12441244
context 'when using Faraday as the transport' do
12451245

@@ -1249,7 +1249,7 @@
12491249
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http)
12501250
end
12511251

1252-
it 'sets the options on the transport' do
1252+
it 'compresses the request and decompresses the response' do
12531253
expect(client.perform_request('GET', '/').body).to be_a(Hash)
12541254
end
12551255

@@ -1268,7 +1268,7 @@
12681268
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :httpclient)
12691269
end
12701270

1271-
it 'sets the options on the transport' do
1271+
it 'compresses the request and decompresses the response' do
12721272
expect(client.perform_request('GET', '/').body).to be_a(Hash)
12731273
end
12741274

@@ -1287,7 +1287,7 @@
12871287
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :patron)
12881288
end
12891289

1290-
it 'sets the options on the transport' do
1290+
it 'compresses the request and decompresses the response' do
12911291
expect(client.perform_request('GET', '/').body).to be_a(Hash)
12921292
end
12931293

@@ -1306,9 +1306,17 @@
13061306
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http_persistent)
13071307
end
13081308

1309-
it 'sets the options on the transport' do
1309+
it 'compresses the request and decompresses the response' do
13101310
expect(client.perform_request('GET', '/').body).to be_a(Hash)
13111311
end
1312+
1313+
it 'sets the Accept-Encoding header' do
1314+
expect(client.transport.connections[0].connection.headers['Accept-Encoding'])
1315+
end
1316+
1317+
it 'preserves the other headers' do
1318+
expect(client.transport.connections[0].connection.headers['User-Agent'])
1319+
end
13121320
end
13131321

13141322
context 'when using the Typhoeus adapter' do
@@ -1317,7 +1325,7 @@
13171325
described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :typhoeus)
13181326
end
13191327

1320-
it 'sets the options on the transport' do
1328+
it 'compresses the request and decompresses the response' do
13211329
expect(client.perform_request('GET', '/').body).to be_a(Hash)
13221330
end
13231331

@@ -1340,17 +1348,17 @@
13401348
transport_class: Elasticsearch::Transport::Transport::HTTP::Curb)
13411349
end
13421350

1351+
it 'compresses the request and decompresses the response' do
1352+
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1353+
end
1354+
13431355
it 'sets the Accept-Encoding header' do
13441356
expect(client.transport.connections[0].connection.headers['Accept-Encoding'])
13451357
end
13461358

13471359
it 'preserves the other headers' do
13481360
expect(client.transport.connections[0].connection.headers['User-Agent'])
13491361
end
1350-
1351-
it 'sets the options on the transport' do
1352-
expect(client.perform_request('GET', '/').body).to be_a(Hash)
1353-
end
13541362
end
13551363

13561364
context 'when using Manticore as the transport', if: jruby? do
@@ -1361,7 +1369,7 @@
13611369
transport_class: Elasticsearch::Transport::Transport::HTTP::Manticore)
13621370
end
13631371

1364-
it 'sets the options on the transport' do
1372+
it 'compresses the request and decompresses the response' do
13651373
expect(client.perform_request('GET', '/').body).to be_a(Hash)
13661374
end
13671375
end

0 commit comments

Comments
 (0)