Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Always use the same zipcode in address factory
Browse files Browse the repository at this point in the history
The Solidus address factory randomizes the zipcode. The OrderWalkThrough we use in the credit card checkout spec uses this factory for the user addresses.

For credit card payments we transmit the billing address to braintree, for paypal payments the shipping address.

As we match the body in our VCR settings VCR can not match the request anymore and therefore cannot replay existing cassettes.

By modifying the spree address factory we ensure that the zipcode is always the same.
  • Loading branch information
tvdeyen committed May 9, 2017
1 parent 97cf08c commit 6ad3a88
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 198 deletions.
11 changes: 11 additions & 0 deletions lib/solidus_paypal_braintree/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@
# Example adding this to your spec_helper will load these Factories for use:
# require 'solidus_paypal_braintree/factories'
end

FactoryGirl.modify do
# The Solidus address factory randomizes the zipcode.
# The OrderWalkThrough we use in the credit card checkout spec uses this factory for the user addresses.
# For credit card payments we transmit the billing address to braintree, for paypal payments the shipping address.
# As we match the body in our VCR settings VCR can not match the request anymore and therefore cannot replay existing cassettes.
#
factory :address do
zipcode '21088-0255'
end
end
199 changes: 100 additions & 99 deletions spec/fixtures/cassettes/checkout/resubmit_credit_card.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6ad3a88

Please sign in to comment.