Skip to content

Commit

Permalink
Replace all usage of :address with :billing_address in test cases
Browse files Browse the repository at this point in the history
git-svn-id: https://activemerchant.googlecode.com/svn/trunk/active_merchant@587 6513ea26-6c20-0410-8a68-89cd7235086d
  • Loading branch information
codyfauser committed Jan 24, 2008
1 parent ee11c33 commit b745e3a
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 58 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
@@ -1,10 +1,10 @@
= ActiveMerchant CHANGELOG

* Replace all usage of :address with :billing_address in test cases [cody]
* Remove sensitive data from NetRegistryGateway responses. Refactor gateway and tests. Remove test_result_from_cc_number. [cody]
* Update VerifiGateway to support avs and cvv data. Remove test_result_from_cc_number. [cody]
* Small refactoring of UsaEpayGateway [cody]
* Update UsaEpayGateway to support avs and cvv data. Remove test_result_from_cc_number. [cody]
* Replace all usage of :address with :billing_address in test cases [cody]
* Update TrustCommerce docs now that the gateway falls back to SSL post when tclink isn't available [cody]
* Change ARB to use correct :address1 key for addresses [cody]
* No need for specialized recurring response for Authorize.net recurring billing [cody]
Expand Down
26 changes: 14 additions & 12 deletions test/remote/gateways/remote_card_stream_test.rb
Expand Up @@ -42,28 +42,30 @@ def setup
)

@mastercard_options = {
:address => { :address1 => '25 The Larches',
:city => "Narborough",
:state => "Leicester",
:zip => 'LE10 2RT'
},
:billing_address => {
:address1 => '25 The Larches',
:city => "Narborough",
:state => "Leicester",
:zip => 'LE10 2RT'
},
:order_id => generate_order_id,
:description => 'Store purchase'
}

@uk_maestro_options = {
:address => { :address1 => 'The Parkway',
:address2 => "Larches Approach",
:city => "Hull",
:state => "North Humberside",
:zip => 'HU7 9OP'
},
:billing_address => {
:address1 => 'The Parkway',
:address2 => "Larches Approach",
:city => "Hull",
:state => "North Humberside",
:zip => 'HU7 9OP'
},
:order_id => generate_order_id,
:description => 'Store purchase'
}

@solo_options = {
:address => {
:billing_address => {
:address1 => '5 Zigzag Road',
:city => 'Isleworth',
:state => 'Middlesex',
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_cyber_source_test.rb
Expand Up @@ -12,7 +12,7 @@ def setup
@amount = 100

@options = {
:address => {
:billing_address => {
:address1 => '1234 My Street',
:address2 => 'Apt 1',
:company => 'Widgets Inc',
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_netbilling_test.rb
Expand Up @@ -20,7 +20,7 @@ def setup
:phone => '650-253-0001'
}

@options = { :address => @address,
@options = { :billing_address => @address,
:description => 'Internet purchase'
}
end
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_payflow_express_test.rb
Expand Up @@ -6,7 +6,7 @@ def setup

@gateway = PayflowExpressGateway.new(fixtures(:payflow))

@options = { :address => {
@options = { :billing_address => {
:name => 'Cody Fauser',
:address1 => '1234 Shady Brook Lane',
:city => 'Ottawa',
Expand Down
23 changes: 12 additions & 11 deletions test/remote/gateways/remote_payflow_uk_test.rb
Expand Up @@ -37,17 +37,18 @@ def setup
:last_name => 'Brooks'
)

@options = { :address => {
:name => 'Cody Fauser',
:address1 => '1234 Shady Brook Lane',
:city => 'Ottawa',
:state => 'ON',
:country => 'CA',
:zip => '90210',
:phone => '555-555-5555'
},
:email => 'cody@example.com'
}
@options = {
:billing_address => {
:name => 'Cody Fauser',
:address1 => '1234 Shady Brook Lane',
:city => 'Ottawa',
:state => 'ON',
:country => 'CA',
:zip => '90210',
:phone => '555-555-5555'
},
:email => 'cody@example.com'
}
end

def test_successful_purchase
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_payment_express_test.rb
Expand Up @@ -10,7 +10,7 @@ def setup
@creditcard = credit_card('4111111111111111')

@options = {
:address => {
:billing_address => {
:name => 'Cody Fauser',
:address1 => '1234 Shady Brook Lane',
:city => 'Ottawa',
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_paypal_express_test.rb
Expand Up @@ -9,7 +9,7 @@ def setup
@options = {
:order_id => '230000',
:email => 'buyer@jadedpallet.com',
:address => { :name => 'Fred Brooks',
:billing_address => { :name => 'Fred Brooks',
:address1 => '1234 Penny Lane',
:city => 'Jonsetown',
:state => 'NC',
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_paypal_test.rb
Expand Up @@ -19,7 +19,7 @@ def setup
@params = {
:order_id => generate_order_id,
:email => 'buyer@jadedpallet.com',
:address => { :name => 'Fred Brooks',
:billing_address => { :name => 'Fred Brooks',
:address1 => '1234 Penny Lane',
:city => 'Jonsetown',
:state => 'NC',
Expand Down
26 changes: 14 additions & 12 deletions test/remote/gateways/remote_protx_test.rb
Expand Up @@ -70,28 +70,30 @@ def setup
)

@mastercard_options = {
:address => { :address1 => '25 The Larches',
:city => "Narborough",
:state => "Leicester",
:zip => 'LE10 2RT'
},
:billing_address => {
:address1 => '25 The Larches',
:city => "Narborough",
:state => "Leicester",
:zip => 'LE10 2RT'
},
:order_id => generate_order_id,
:description => 'Store purchase'
}

@maestro_options = {
:address => { :address1 => 'The Parkway',
:address2 => "Larches Approach",
:city => "Hull",
:state => "North Humberside",
:zip => 'HU7 9OP'
},
:billing_address => {
:address1 => 'The Parkway',
:address2 => "Larches Approach",
:city => "Hull",
:state => "North Humberside",
:zip => 'HU7 9OP'
},
:order_id => generate_order_id,
:description => 'Store purchase'
}

@solo_options = {
:address => {
:billing_address => {
:address1 => '5 Zigzag Road',
:city => 'Isleworth',
:state => 'Middlesex',
Expand Down
18 changes: 9 additions & 9 deletions test/remote/gateways/remote_psl_card_test.rb
Expand Up @@ -24,15 +24,15 @@ def setup

def test_successful_visa_purchase
response = @gateway.purchase(ACCEPT_AMOUNT, @visa,
:address => @visa_address
:billing_address => @visa_address
)
assert_success response
assert response.test?
end

def test_successful_visa_purchase_specifying_currency
response = @gateway.purchase(ACCEPT_AMOUNT, @visa,
:address => @visa_address,
:billing_address => @visa_address,
:currency => 'GBP'
)
assert_success response
Expand All @@ -41,39 +41,39 @@ def test_successful_visa_purchase_specifying_currency

def test_successful_solo_purchase
response = @gateway.purchase(ACCEPT_AMOUNT, @solo,
:address => @solo_address
:billing_address => @solo_address
)
assert_success response
assert response.test?
end

def test_referred_purchase
response = @gateway.purchase(REFERRED_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_failure response
assert response.test?
end

def test_declined_purchase
response = @gateway.purchase(DECLINED_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_failure response
assert response.test?
end

def test_declined_keep_card_purchase
response = @gateway.purchase(KEEP_CARD_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_failure response
assert response.test?
end

def test_successful_authorization
response = @gateway.authorize(ACCEPT_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_success response
assert response.test?
Expand All @@ -84,15 +84,15 @@ def test_no_login
:login => ''
)
response = @gateway.authorize(ACCEPT_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_failure response
assert response.test?
end

def test_successful_authorization_and_capture
authorization = @gateway.authorize(ACCEPT_AMOUNT, @uk_maestro,
:address => @uk_maestro_address
:billing_address => @uk_maestro_address
)
assert_success authorization
assert authorization.test?
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_trust_commerce_test.rb
Expand Up @@ -76,7 +76,7 @@ def test_purchase_with_avs_for_invalid_address
end

def test_successful_authorize_with_avs
assert response = @gateway.authorize(@amount, @credit_card, {:address => @valid_address})
assert response = @gateway.authorize(@amount, @credit_card, :billing_address => @valid_address)

assert_equal "Y", response.avs_result["code"]
assert_match /The transaction was successful/, response.message
Expand Down
2 changes: 1 addition & 1 deletion test/remote/gateways/remote_viaklix_test.rb
Expand Up @@ -12,7 +12,7 @@ def setup
:order_id => '#1000.1',
:email => "paul@domain.com",
:description => 'Test Transaction',
:address => {
:billing_address => {
:address1 => '164 Waverley Street',
:address2 => 'APT #7',
:country => 'US',
Expand Down
2 changes: 1 addition & 1 deletion test/unit/gateways/cyber_source_test.rb
Expand Up @@ -13,7 +13,7 @@ def setup
@credit_card = credit_card('4111111111111111', :type => 'visa')
@declined_card = credit_card('801111111111111', :type => 'visa')

@options = { :address => {
@options = { :billing_address => {
:address1 => '1234 My Street',
:address2 => 'Apt 1',
:company => 'Widgets Inc',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/gateways/eway_test.rb
Expand Up @@ -11,7 +11,7 @@ def setup
@options = {
:order_id => '1230123',
:email => 'bob@testbob.com',
:address => {
:billing_address => {
:address1 => '1234 First St.',
:address2 => 'Apt. 1',
:city => 'Melbourne',
Expand Down Expand Up @@ -76,7 +76,7 @@ def test_add_address
post = {}
@gateway.send(:add_address, post, @options)
assert_equal '1234 First St., Apt. 1, Melbourne, ACT, AU', post[:CustomerAddress]
assert_equal @options[:address][:zip], post[:CustomerPostcode]
assert_equal @options[:billing_address][:zip], post[:CustomerPostcode]
end

private
Expand Down
2 changes: 1 addition & 1 deletion test/unit/gateways/paypal_test.rb
Expand Up @@ -17,7 +17,7 @@ def setup
end

def test_no_ip_address
assert_raise(ArgumentError){ @gateway.purchase(@amount, @credit_card, :address => address)}
assert_raise(ArgumentError){ @gateway.purchase(@amount, @credit_card, :billing_address => address)}
end

def test_successful_purchase
Expand Down
2 changes: 1 addition & 1 deletion test/unit/gateways/viaklix_test.rb
Expand Up @@ -13,7 +13,7 @@ def setup
:order_id => '37',
:email => "paul@domain.com",
:description => 'Test Transaction',
:address => {
:billing_address => {
:address1 => '164 Waverley Street',
:address2 => 'APT #7',
:country => 'US',
Expand Down

0 comments on commit b745e3a

Please sign in to comment.