From 2c808c8b468f2ab790e32468198435e02bbfa856 Mon Sep 17 00:00:00 2001 From: serknight Date: Fri, 2 Jul 2021 16:10:40 -0600 Subject: [PATCH] attr for grant type, and test --- lib/xero-ruby/api_client.rb | 2 +- spec/api_client_spec.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index bf3d70ca..16294ba1 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -29,7 +29,7 @@ class ApiClient # Defines the headers to be used in HTTP requests of all API calls by default. # # @return [Hash] - attr_accessor :default_headers + attr_accessor :default_headers, :grant_type # Initializes the ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 54c38119..f9719b39 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -80,8 +80,7 @@ client_secret: '123', } api_client = XeroRuby::ApiClient.new(credentials: creds) - puts api_client.inspect - expect(api_client.grant_type).to eq('authoizaraion_code') + expect(api_client.grant_type).to eq('authorization_code') end end @@ -93,7 +92,7 @@ grant_type: 'client_credentials' } api_client = XeroRuby::ApiClient.new(credentials: creds) - expect(api_client.grant_type).to eq('client_credentialsz') + expect(api_client.grant_type).to eq('client_credentials') end end