Commit 8a99c122 by lanrion

Merge branch 'master' into broadcast-apis

Conflicts:
	lib/weixin_authorize/version.rb
parents 935976ab 1d6fbe28
......@@ -7,7 +7,7 @@
Support using [Redis](http://redis.io) to store `access_token`
[查看Wiki](https://github.com/lanrion/weixin_authorize/wiki)
[Wiki](https://github.com/lanrion/weixin_authorize/wiki)
[Getting-Started](https://github.com/lanrion/weixin_authorize/wiki/Getting-Started)
......@@ -15,16 +15,19 @@ Support using [Redis](http://redis.io) to store `access_token`
## How to test
Go to https://github.com/lanrion/weixin_authorize/issues/2, apply a weixin sandbox test account and follow this account, then add them to your `~/.bash_profile`
Go to https://github.com/lanrion/weixin_authorize/issues/2, apply a weixin sandbox test account and follow this account
https://github.com/lanrion/weixin_authorize/blob/master/spec/spec_helper.rb
change your infos:
```ruby
ENV["APPID"]="wxe371e0960de5426a"
ENV["APPSECRET"]="572b93d3d20aea242692a804243a141b"
ENV["OPENID"]="oEEoyuEasxionjR5HygmEOQGwRcw"
```
export APPID="your test account weixin app_id"
export APPSECRET="your test account weixin appsecret"
export OPENID="your weixin openid"
```
Last, you have to **open a new terminal tag (Reload bash_profile)** , and run `rspec .`
**微信API挺SB,客服消息API,如果出现45015(回复时间超过限制),那么需要取消关注测试账号,然后再重新关注一次即可。另外,创建用户分组API刚开始测试的时候是OK的,后来会出现-1(系统繁忙),然后一直是这样。**
then run `rspec .`
## Contributing
......
......@@ -54,8 +54,8 @@ module WeixinAuthorize
"http://file.api.weixin.qq.com/cgi-bin"
end
def mp_endpoint
"https://mp.weixin.qq.com/cgi-bin"
def mp_endpoint(url)
"https://mp.weixin.qq.com/cgi-bin#{url}"
end
end
......
module WeixinAuthorize
VERSION = "1.5.9"
VERSION = "1.6.0"
end
......@@ -12,7 +12,7 @@ describe WeixinAuthorize::Api::Groups do
it "create a group" do
response = $client.create_group(group_name)
if response.code == WeixinAuthorize::OK_CODE
expect(response["group"]["name"]).to eq(group_name)
expect(response.result["group"]["name"]).to eq(group_name)
else
expect(response.code).to eq(-1)
puts "SB WEIXIN says: system error"
......
......@@ -15,4 +15,10 @@ describe WeixinAuthorize::Api::Qrcode do
expect(response.result.keys).to eq(["ticket"])
end
it "#return_qr_url" do
response = $client.create_qr_limit_scene("1234")
qr_url = $client.qr_code_url(response.result["ticket"])
expect(response.code).to eq(WeixinAuthorize::OK_CODE)
expect(qr_url).to match(/(\S+\.(com|net|org|edu|gov)(\/\S+)?)/)
end
end
......@@ -37,9 +37,9 @@ SimpleCov.start
ENV['CODECLIMATE_REPO_TOKEN'] = "c91fecbbd9e414e7cc3ad7a7d99207145de0ac65a3368de09e8c19295343d399"
CodeClimate::TestReporter.start
ENV["APPID"]="wx986f04063d341d04"
ENV["APPSECRET"]="1a941cd88cb4579ba98ec06b6813af03"
ENV["OPENID"]="o9k6BuB0kydAcPTc7sPxppB1GQqA"
ENV["APPID"]="wxe371e0960de5426a"
ENV["APPSECRET"]="572b93d3d20aea242692a804243a141b"
ENV["OPENID"]="oEEoyuEasxionjR5HygmEOQGwRcw"
# Comment to test for ClientStorage
redis = Redis.new(:host => "127.0.0.1",:port => "6379")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment