Use retry_with_error in UserRefreshCredentials#revoke!
This commit is contained in:
1 parent
a1a9387c2b
commit
40f4e166a2
2 files changed
+28
-9
No files matched your search
@@ -293,4 +293,20 @@ describe Google::Auth::UserRefreshCredentials do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when erros occured with request' do
|
||||
it 'should fail with Signet::AuthorizationError if request times out' do
|
||||
allow_any_instance_of(Faraday::Connection).to receive(:get)
|
||||
.and_raise(Faraday::TimeoutError)
|
||||
expect { @client.revoke! }
|
||||
.to raise_error Signet::AuthorizationError
|
||||
end
|
||||
|
||||
it 'should fail with Signet::AuthorizationError if request fails' do
|
||||
allow_any_instance_of(Faraday::Connection).to receive(:get)
|
||||
.and_raise(Faraday::ConnectionFailed, nil)
|
||||
expect { @client.revoke! }
|
||||
.to raise_error Signet::AuthorizationError
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user