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
b9d4b1a9
Commit
b9d4b1a9
authored
Mar 27, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#get_access_token should raise error if app_secret or appid is invalid
parent
f1b63a54
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
lib/weixin_authorize/client.rb
+1
-0
spec/1_fetch_access_token_spec.rb
+5
-0
No files found.
lib/weixin_authorize/client.rb
View file @
b9d4b1a9
...
@@ -57,6 +57,7 @@ module WeixinAuthorize
...
@@ -57,6 +57,7 @@ module WeixinAuthorize
# authenticate access_token
# authenticate access_token
def
authenticate
def
authenticate
raise
"APPID or APPSECRET is invalid"
if
!
is_valid?
if
is_weixin_redis_blank?
if
is_weixin_redis_blank?
set_access_token_for_client
set_access_token_for_client
else
else
...
...
spec/1_fetch_access_token_spec.rb
View file @
b9d4b1a9
...
@@ -23,5 +23,10 @@ describe WeixinAuthorize::Client do
...
@@ -23,5 +23,10 @@ describe WeixinAuthorize::Client do
valid_info
=
$client_1
.
is_valid?
valid_info
=
$client_1
.
is_valid?
expect
(
valid_info
).
to
eq
(
false
)
expect
(
valid_info
).
to
eq
(
false
)
end
end
it
"#get_access_token should raise error if app_secret or appid is invalid"
do
$client_2
=
WeixinAuthorize
::
Client
.
new
(
"appid_2"
,
"app_secret_2"
)
expect
{
$client_2
.
get_access_token
}.
to
raise_error
(
RuntimeError
)
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