Skip to content

Commit be20e65

Browse files
committed
Rename issue_access_token => issue_channel_token / revoke_access_token => revoke_channel_token
1 parent aa6fadb commit be20e65

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/line/bot/client.rb

Lines changed: 2 additions & 2 deletions
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 = 'client_credentials')
65+
def issue_channel_token(grant_type = 'client_credentials')
6666
payload = URI.encode_www_form(
6767
grant_type: grant_type,
6868
client_id: channel_id,
@@ -83,7 +83,7 @@ def issue_access_token(grant_type = 'client_credentials')
8383
# Revoke channel access token
8484
#
8585
# @return [Net::HTTPResponse]
86-
def revoke_access_token(access_token)
86+
def revoke_channel_token(access_token)
8787
payload = URI.encode_www_form(access_token: access_token)
8888

8989
request = Request.new do |config|

spec/line/bot/client_access_token_spec.rb renamed to spec/line/bot/client_channel_token_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'webmock/rspec'
33
require 'json'
44

5-
OAUTH_ACCESS_TOKEN_ISSUE_CONTENT = <<"EOS"
5+
OAUTH_CHANNEL_TOKEN_ISSUE_CONTENT = <<"EOS"
66
{
77
"access_token": "W1TeHCgfH2Liwaxxxxx1",
88
"expires_in": 2592000,
@@ -29,10 +29,10 @@ def generate_client
2929

3030
it 'issues an oauth access token' do
3131
uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/oauth/accessToken'
32-
stub_request(:post, uri_template).to_return { |request| {body: OAUTH_ACCESS_TOKEN_ISSUE_CONTENT, status: 200} }
32+
stub_request(:post, uri_template).to_return { |request| {body: OAUTH_CHANNEL_TOKEN_ISSUE_CONTENT, status: 200} }
3333

3434
client = generate_client
35-
response = client.issue_access_token
35+
response = client.issue_channel_token
3636

3737
expect(response).to be_a(Net::HTTPOK)
3838
result = JSON.parse(response.body)
@@ -47,7 +47,7 @@ def generate_client
4747

4848
client = generate_client
4949

50-
response = client.revoke_access_token('W1TeHCgfH2Liwaxxxxx1')
50+
response = client.revoke_channel_token('W1TeHCgfH2Liwaxxxxx1')
5151

5252
expect(response).to be_a(Net::HTTPOK)
5353
end

0 commit comments

Comments
 (0)