Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
b62b15c4
Commit
b62b15c4
authored
Apr 01, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for return the different access_token after token is expired
parent
6572554c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
spec/1_fetch_access_token_spec.rb
+12
-0
No files found.
spec/1_fetch_access_token_spec.rb
View file @
b62b15c4
...
@@ -28,5 +28,17 @@ describe WeixinAuthorize::Client do
...
@@ -28,5 +28,17 @@ describe WeixinAuthorize::Client do
$client_2
=
WeixinAuthorize
::
Client
.
new
(
"appid_2"
,
"app_secret_2"
)
$client_2
=
WeixinAuthorize
::
Client
.
new
(
"appid_2"
,
"app_secret_2"
)
expect
{
$client_2
.
get_access_token
}.
to
raise_error
(
RuntimeError
)
expect
{
$client_2
.
get_access_token
}.
to
raise_error
(
RuntimeError
)
end
end
it
"#token_expired return the different access_token after token is expired"
do
token_1
=
$client
.
get_access_token
if
WeixinAuthorize
.
weixin_redis
.
nil?
$client
.
expired_at
=
Time
.
now
.
to_i
-
7300
else
WeixinAuthorize
.
weixin_redis
.
del
(
$client
.
redis_key
)
end
token_2
=
$client
.
get_access_token
expect
(
token_1
).
to_not
eq
(
token_2
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment