test/alipay/notify_test.rb in alipay-0.6.0.beta1 vs test/alipay/notify_test.rb in alipay-0.6.0.beta2
- old
+ new
@@ -1,26 +1,29 @@
require 'test_helper'
class Alipay::NotifyTest < Minitest::Test
def setup
- @options = {
+ @params = {
:notify_id => '1234',
- :sign_type => 'MD5'
}
- @sign_options = @options.merge(:sign => Alipay::Sign.generate(@options))
+ @unsign_params = @params.merge(:sign_type => 'MD5', :sign => 'xxxx')
+ @sign_params = @params.merge(
+ :sign_type => 'MD5',
+ :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")
- assert !Alipay::Notify.verify?(@options)
+ 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")
- assert Alipay::Notify.verify?(@sign_options)
+ 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")
- assert !Alipay::Notify.verify?(@sign_options)
+ assert !Alipay::Notify.verify?(@sign_params)
end
end