Sha256: a9f83b0c08f917b4cdfc9a152b030d542a0048df301c85344863317935bfd4b8

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

require 'test_helper'

class Alipay::Wap::SignTest < Minitest::Test
  def setup
    @params = {
      :v => '1.0',
      :sec_id => 'MD5',
      :service => 'test',
      :notify_data => 'notify_data'
    }
    @sign = Digest::MD5.hexdigest("service=test&v=1.0&sec_id=MD5&notify_data=notify_data#{Alipay.key}")
  end

  def test_verify_sign
    assert !Alipay::Wap::Sign.verify?(@params)
    assert !Alipay::Wap::Sign.verify?(@params.merge(:sec_id => 'unknow'))
    assert Alipay::Wap::Sign.verify?(@params.merge(:sign => @sign, :whatever => 'x'))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alipay-0.6.0.beta3 test/alipay/wap/sign_test.rb