Skip to content

Commit aa6fadb

Browse files
committed
Set default value for an argument of #issue_access_token
1 parent 3467baa commit aa6fadb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/line/bot/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def credentials
6262
# @param grant_type [String] Grant type
6363
#
6464
# @return [Net::HTTPResponse]
65-
def issue_access_token(grant_type)
65+
def issue_access_token(grant_type = 'client_credentials')
6666
payload = URI.encode_www_form(
6767
grant_type: grant_type,
6868
client_id: channel_id,

spec/line/bot/client_access_token_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ def generate_client
3232
stub_request(:post, uri_template).to_return { |request| {body: OAUTH_ACCESS_TOKEN_ISSUE_CONTENT, status: 200} }
3333

3434
client = generate_client
35-
grant_type = 'client_credentials'
36-
37-
response = client.issue_access_token(grant_type)
35+
response = client.issue_access_token
3836

3937
expect(response).to be_a(Net::HTTPOK)
4038
result = JSON.parse(response.body)

0 commit comments

Comments
 (0)