Skip to content

Instantly share code, notes, and snippets.

@dvdantunes
Last active January 8, 2020 21:17
Show Gist options
  • Save dvdantunes/5bb5857650f57bec6cfda31e362d12eb to your computer and use it in GitHub Desktop.
Save dvdantunes/5bb5857650f57bec6cfda31e362d12eb to your computer and use it in GitHub Desktop.
Spree snipets
Spree
********
* Create new user
u = Spree::User.new(first_name: 'david', last_name: 'antunes', email: 'dantunes@acid.cl', password: 'spree123', password_confirmation: 'spree123', rut: 241237036)
u.save!
* Spree defase override test
docker-compose run website rake deface:get_result['spree/checkout/_confirm']
* Test credit card (Bogus Gateway)
https://stackoverflow.com/questions/19794660/rails-spree-cant-checkout-in-test-env-unable-to-authorize-credit-card-bogus
To pass the checkout steps in other to place a successful test order follow the following steps.
Name on card
Enter 'Bogus Gateway'
Credit card number
Enter each of these in turn to simulate different types of transaction:
1: to simulate a successful transaction
2: to simulate a failed transaction
3: to simulate an Exception (this generates a message indicating that an error has occurred with the provider.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment