Skip to content

Commit

Permalink
Add test to verify new Quickpay gateway behavior
Browse files Browse the repository at this point in the history
 -add_testmode method should NOT add a testmode parameter to the
  post hash if a transaction id is present
 -add_testmode method should add a testmode parameter equal to the
  test? method if there is no transaction id

 refs activemerchant#234
  • Loading branch information
brentmc79 committed Dec 7, 2011
1 parent 3a9f863 commit 54ce542
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/gateways/quickpay_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ def test_supported_countries
def test_supported_card_types
assert_equal [ :dankort, :forbrugsforeningen, :visa, :master, :american_express, :diners_club, :jcb, :maestro ], QuickpayGateway.supported_cardtypes
end

def test_add_testmode_does_not_add_testmode_if_transaction_id_present
post_hash = {:transaction => "12345"}
@gateway.send(:add_testmode, post_hash)
assert_equal nil, post_hash[:testmode]
end

def test_add_testmode_adds_a_testmode_param_if_transaction_id_not_present
post_hash = {}
@gateway.send(:add_testmode, post_hash)
assert_equal '1', post_hash[:testmode]
end

private

Expand Down

0 comments on commit 54ce542

Please sign in to comment.