test/alipay/notify_test.rb in alipay-0.13.0 vs test/alipay/notify_test.rb in alipay-0.14.0
- old
+ new
@@ -11,19 +11,25 @@
sign: '22fc7e38e5acdfede396aa463870d111'
)
end
def test_unsign_notify
- FakeWeb.register_uri(:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234", body: "true")
+ stub_request(
+ :get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234"
+ ).to_return(body: "true")
assert !Alipay::Notify.verify?(@unsign_params)
end
def test_verify_notify_when_true
- FakeWeb.register_uri(:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234", body: "true")
+ stub_request(
+ :get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234"
+ ).to_return(body: "true")
assert Alipay::Notify.verify?(@sign_params)
end
def test_verify_notify_when_false
- FakeWeb.register_uri(:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234", body: "false")
+ stub_request(
+ :get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234"
+ ).to_return(body: "false")
assert !Alipay::Notify.verify?(@sign_params)
end
end