spec/integration/errors_spec.rb in currency_cloud-0.7.1 vs spec/integration/errors_spec.rb in currency_cloud-0.7.2
- old
+ new
@@ -139,14 +139,14 @@
it 'is raised when a resource is not found' do
CurrencyCloud.token = '656485646b068f6e9c81e3d885fa54f5'
error = nil
begin
- CurrencyCloud::Beneficiary.retrieve('081596c9-02de-483e-9f2a-4cf55dcdf98c')
+ CurrencyCloud::Beneficiary.retrieve('081596c9-02de-483e-9f2a-4cf55dcdf98c')
raise 'Should fail'
rescue CurrencyCloud::NotFoundError => error
- end
+ end
expect(error.code).to eq('beneficiary_not_found')
expect(error.raw_response).to_not be_nil
expect(error.status_code).to eq(404)
expect(error.messages.length).to eq(1)
@@ -155,11 +155,11 @@
expect(error_message.field).to eq('id')
expect(error_message.code).to eq('beneficiary_not_found')
expect(error_message.message).to eq('Beneficiary was not found for this id')
expect(error_message.params).to be_empty
end
-
+
it 'is raised on an internal server error' do
error = nil
begin
CurrencyCloud.session
@@ -176,18 +176,18 @@
expect(error_message.field).to eq('base')
expect(error_message.code).to eq('internal_application_error')
expect(error_message.message).to eq('A general application error occurred')
expect(error_message.params).to include("request_id" => 2771875643610572878)
end
-
+
it 'is raised when too many requests have been issued' do
CurrencyCloud.login_id = 'rjnienaber@gmail.com2'
error = nil
begin
CurrencyCloud.session
-
+
raise 'Should have failed'
rescue CurrencyCloud::TooManyRequestsError => error
end
expect(error.code).to eq('too_many_requests')
@@ -199,6 +199,6 @@
expect(error_message.field).to eq('base')
expect(error_message.code).to eq('too_many_requests')
expect(error_message.message).to eq('Too many requests have been made to the api. Please refer to the Developer Center for more information')
expect(error_message.params).to be_empty
end
-end
\ No newline at end of file
+end