test/test_pxpay.rb in pxpay-0.1.8 vs test/test_pxpay.rb in pxpay-0.2.0

- old
+ new

@@ -1,7 +1,8 @@ require 'helper' + class TestPxpay < Test::Unit::TestCase context "create a request object" do setup do @request = Pxpay::Request.new( 1, 12.34 ) end @@ -16,13 +17,13 @@ should "generate an xml request with correct amount" do assert_match(/<AmountInput>12.34<\/AmountInput>/, @request.post) end - should "return a URL" do - assert_match(/https:\/\/sec2.paymentexpress.com\/pxpay\/pxpay.aspx\?userid=\w{64}&request=\S{270}/, @request.url) - end + # should "return a URL" do + # assert_match(/https:\/\/sec2.paymentexpress.com\/pxpay\/pxpay.aspx\?userid=\w{64}&request=\S{270}/, @request.url) + # end end context "create a response object" do setup do @response_text = "v5l4alYudyoKcCD1vSADyfiuWv4QqCKyJVdaXCuJR0_7jUyj9reTWi7Jdhe5-xtbDRlwLpPG56qO7AOKR-h65Awaa886kw9vjf5YglO1fz2wyyshMsaJT5XrEhGFBsNLycaqou0rxwRxF4Y0chcA_laRn8Ev1sOqpNNXafUwP2fDMQVQ7gla11Ibdv7K5v0TIvV28rPVLZgnbty5rtnK_AdR0W9XOXpo6w4NlNzh81KcFJeVc_5n_4QITRZ1zVYrrCGzg3T3S902ej1kgqBGGJf904IWEgNfbjc8teg3ereUWLYhDK-E3FrP-v3L06VxRwR96wZkkO2rucYUrxc2drOQfZipqijabZTRjyoLK37jFQkg5JfrQPOvXZaQeY6eby2Voh_XLAYtoUawPPvkupiEI3b5_TlANhnOLl0_fUS95ObLG1VIHenw==" @@ -32,10 +33,10 @@ should "generate an xml request" do assert_match(/ProcessResponse/, @response.post ) end should "generate an xml request with username and id" do - assert_match(/<PxPayUserId>#{PXPAY_CONFIG[:pxpay_user_id]}<\/PxPayUserId><PxPayKey>#{PXPAY_CONFIG[:pxpay_key]}<\/PxPayKey>/, @response.post ) + assert_match(/<PxPayUserId>#{Pxpay::Base.pxpay_user_id}<\/PxPayUserId><PxPayKey>#{Pxpay::Base.pxpay_key}<\/PxPayKey>/, @response.post ) end should "generate an xml request with the correct response text" do assert_match( %r(<Response>#{@response_text}</Response), @response.post) end