|
1239 | 1239 | end |
1240 | 1240 | end |
1241 | 1241 |
|
1242 | | - context 'when \'transport_options\' are defined with \'accept_encoding\' specified' do |
| 1242 | + context 'when the \'compression\' option is set to true' do |
1243 | 1243 |
|
1244 | 1244 | context 'when using Faraday as the transport' do |
1245 | 1245 |
|
|
1249 | 1249 | described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http) |
1250 | 1250 | end |
1251 | 1251 |
|
1252 | | - it 'sets the options on the transport' do |
| 1252 | + it 'compresses the request and decompresses the response' do |
1253 | 1253 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1254 | 1254 | end |
1255 | 1255 |
|
|
1268 | 1268 | described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :httpclient) |
1269 | 1269 | end |
1270 | 1270 |
|
1271 | | - it 'sets the options on the transport' do |
| 1271 | + it 'compresses the request and decompresses the response' do |
1272 | 1272 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1273 | 1273 | end |
1274 | 1274 |
|
|
1287 | 1287 | described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :patron) |
1288 | 1288 | end |
1289 | 1289 |
|
1290 | | - it 'sets the options on the transport' do |
| 1290 | + it 'compresses the request and decompresses the response' do |
1291 | 1291 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1292 | 1292 | end |
1293 | 1293 |
|
|
1306 | 1306 | described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :net_http_persistent) |
1307 | 1307 | end |
1308 | 1308 |
|
1309 | | - it 'sets the options on the transport' do |
| 1309 | + it 'compresses the request and decompresses the response' do |
1310 | 1310 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1311 | 1311 | 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 |
1312 | 1320 | end |
1313 | 1321 |
|
1314 | 1322 | context 'when using the Typhoeus adapter' do |
|
1317 | 1325 | described_class.new(hosts: ELASTICSEARCH_HOSTS, compression: true, adapter: :typhoeus) |
1318 | 1326 | end |
1319 | 1327 |
|
1320 | | - it 'sets the options on the transport' do |
| 1328 | + it 'compresses the request and decompresses the response' do |
1321 | 1329 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1322 | 1330 | end |
1323 | 1331 |
|
|
1340 | 1348 | transport_class: Elasticsearch::Transport::Transport::HTTP::Curb) |
1341 | 1349 | end |
1342 | 1350 |
|
| 1351 | + it 'compresses the request and decompresses the response' do |
| 1352 | + expect(client.perform_request('GET', '/').body).to be_a(Hash) |
| 1353 | + end |
| 1354 | + |
1343 | 1355 | it 'sets the Accept-Encoding header' do |
1344 | 1356 | expect(client.transport.connections[0].connection.headers['Accept-Encoding']) |
1345 | 1357 | end |
1346 | 1358 |
|
1347 | 1359 | it 'preserves the other headers' do |
1348 | 1360 | expect(client.transport.connections[0].connection.headers['User-Agent']) |
1349 | 1361 | end |
1350 | | - |
1351 | | - it 'sets the options on the transport' do |
1352 | | - expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1353 | | - end |
1354 | 1362 | end |
1355 | 1363 |
|
1356 | 1364 | context 'when using Manticore as the transport', if: jruby? do |
|
1361 | 1369 | transport_class: Elasticsearch::Transport::Transport::HTTP::Manticore) |
1362 | 1370 | end |
1363 | 1371 |
|
1364 | | - it 'sets the options on the transport' do |
| 1372 | + it 'compresses the request and decompresses the response' do |
1365 | 1373 | expect(client.perform_request('GET', '/').body).to be_a(Hash) |
1366 | 1374 | end |
1367 | 1375 | end |
|
0 commit comments