test/alipay/wap/service_test.rb in alipay-0.13.0 vs test/alipay/wap/service_test.rb in alipay-0.14.0
- old
+ new
@@ -15,15 +15,14 @@
&service=alipay.wap.trade.create.direct
&v=2.0
&sign=SIGN
EOS
- FakeWeb.register_uri(
+ stub_request(
:get,
- %r|https://wappaygw\.alipay\.com/service/rest\.htm.*|,
- body: body
- )
+ %r|https://wappaygw\.alipay\.com/service/rest\.htm.*|
+ ).to_return(body: body)
assert_equal token, Alipay::Wap::Service.trade_create_direct_token(
req_data: {
seller_account_name: 'account@example.com',
out_trade_no: '1',
@@ -37,14 +36,15 @@
def test_auth_and_execute_url
assert_equal 'https://wappaygw.alipay.com/service/rest.htm?service=alipay.wap.auth.authAndExecute&req_data=%3Cauth_and_execute_req%3E%3Crequest_token%3Etoken_test%3C%2Frequest_token%3E%3C%2Fauth_and_execute_req%3E&partner=1000000000000000&format=xml&v=2.0&sec_id=MD5&sign=3efe60d4a9b7960ba599da6764c959df', Alipay::Wap::Service.auth_and_execute_url(request_token: 'token_test')
end
def test_security_risk_detect
- FakeWeb.register_uri(
+ stub_request(
:post,
- %r|https://wappaygw\.alipay\.com/service/rest\.htm.*|,
- body: ''
+ %r|https://wappaygw\.alipay\.com/service/rest\.htm.*|
+ ).to_return(
+ body: ' '
)
params = {
order_no: '1',
order_credate_time: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
@@ -60,8 +60,8 @@
options = {
sign_type: 'RSA',
key: TEST_RSA_PRIVATE_KEY
}
- assert_equal '', Alipay::Wap::Service.security_risk_detect(params, options).body
+ assert_equal ' ', Alipay::Wap::Service.security_risk_detect(params, options).body
end
end