Commit d3e28ff1 by lanrion

fixed test and clean codes

parent 2124121e
...@@ -33,9 +33,6 @@ module WeixinAuthorize ...@@ -33,9 +33,6 @@ module WeixinAuthorize
WeixinAuthorize.http_get_without_token("/sns/userinfo?access_token=#{oauth_token}&openid=#{openid}&lang=#{lang}", {}, "api") WeixinAuthorize.http_get_without_token("/sns/userinfo?access_token=#{oauth_token}&openid=#{openid}&lang=#{lang}", {}, "api")
end end
private
end end
end end
end end
\ No newline at end of file
...@@ -5,16 +5,16 @@ describe WeixinAuthorize::Api::Qrcode do ...@@ -5,16 +5,16 @@ describe WeixinAuthorize::Api::Qrcode do
it "#create_qr_scene" do it "#create_qr_scene" do
response = $client.create_qr_scene("123") response = $client.create_qr_scene("123")
expect(response.code).to eq(WeixinAuthorize::OK_CODE) expect(response.code).to eq(WeixinAuthorize::OK_CODE)
expect(response.result.keys).to eq(["ticket", "expire_seconds"]) expect(response.result.keys).to eq(["ticket", "expire_seconds", "url"])
expect(response.result["expire_seconds"]).to eq(1800) expect(response.result["expire_seconds"]).to eq(1800)
end end
it "#create_qr_limit_scene" do it "#create_qr_limit_scene" do
response = $client.create_qr_limit_scene("1234") response = $client.create_qr_limit_scene("1234")
expect(response.code).to eq(WeixinAuthorize::OK_CODE) expect(response.code).to eq(WeixinAuthorize::OK_CODE)
expect(response.result.keys).to eq(["ticket"]) expect(response.result.keys).to eq(["ticket", "url"])
end end
it "#return_qr_url" do it "#return_qr_url" do
response = $client.create_qr_limit_scene("1234") response = $client.create_qr_limit_scene("1234")
qr_url = $client.qr_code_url(response.result["ticket"]) qr_url = $client.qr_code_url(response.result["ticket"])
......
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