spec/rest/base_client_spec.rb in finapps-2.0.6 vs spec/rest/base_client_spec.rb in finapps-2.0.10
- old
+ new
@@ -1,7 +1,11 @@
+# frozen_string_literal: true
RSpec.describe FinApps::REST::BaseClient do
- let(:valid_tenant_options) { {tenant_credentials: VALID_CREDENTIALS} }
+ let(:valid_tenant_options) do
+ {tenant_identifier: VALID_CREDENTIALS[:identifier],
+ tenant_token: VALID_CREDENTIALS[:token]}
+ end
subject { FinApps::REST::BaseClient.new(valid_tenant_options) }
RESPONSE = 0
ERROR_MESSAGES = 1
let(:return_array) { %i(RESPONSE ERROR_MESSAGES) }
@@ -52,13 +56,13 @@
end
context 'for client errors' do
subject { FinApps::REST::BaseClient.new(valid_tenant_options).send_request('client_error', :get) }
- it('the result should be nil') { expect(subject[RESPONSE]).to be_nil }
- it { expect(subject[ERROR_MESSAGES]).not_to be_nil }
- it { expect(subject[ERROR_MESSAGES]).to be_a(Array) }
- it { expect(subject[ERROR_MESSAGES].length).to be > 0 }
+ it('result is null') { expect(subject[RESPONSE]).to be_nil }
+ it('error_messages is not null') { expect(subject[ERROR_MESSAGES]).not_to be_nil }
+ it('error_messages is an array') { expect(subject[ERROR_MESSAGES]).to be_a(Array) }
+ it('error messages array contains elements') { expect(subject[ERROR_MESSAGES].length).to be > 0 }
end
context 'for server errors' do
subject { FinApps::REST::BaseClient.new(valid_tenant_options).send_request('server_error', :get) }