Skip to content

Commit b53b80d

Browse files
checking token in retry case
1 parent 1940188 commit b53b80d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

google-apis-core/spec/google/apis/core/api_command_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,17 @@
255255
command.options.add_invocation_id_header = true
256256
result = command.execute(client)
257257
invocation_id_header = command.header["X-Goog-Api-Client"]
258-
259258
expect(invocation_id_header).to include("gccl-invocation-id")
260259
expect(a_request(:get, 'https://www.googleapis.com/zoo/animals')
261260
.with { |req| req.headers['X-Goog-Api-Client'] == invocation_id_header }).to have_been_made.times(2)
262261
end
262+
263+
it 'should keep same idempotency_token across retries' do
264+
command.options.add_idempotency_token_header = true
265+
result = command.execute(client)
266+
idempotency_token_header = command.header['X-Goog-Gcs-Idempotency-Token']
267+
expect(command.header['X-Goog-Gcs-Idempotency-Token']).to eq(idempotency_token_header)
268+
end
263269
end
264270

265271
context('with a project not linked response') do

0 commit comments

Comments
 (0)