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

Commit

Permalink
Use VCR for CheckoutsControllerSpec
Browse files Browse the repository at this point in the history
This test now creates a payment profile, and needs to be wrapped with
VCR to avoid hitting the network during test runs.
  • Loading branch information
stewart committed Sep 7, 2016
1 parent 92360a3 commit 15f0fb8
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 5 deletions.
7 changes: 3 additions & 4 deletions app/models/solidus_paypal_braintree/gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ def create_profile(payment)
result = Braintree::Customer.create
customer_id = result.customer.id

customer = source.create_customer(braintree_customer_id: customer_id)
source.save!

customer
source.create_customer!(braintree_customer_id: customer_id).tap do
source.save!
end
end

# @return [String]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
RSpec.describe SolidusPaypalBraintree::CheckoutsController, type: :controller do
include_context 'order ready for payment'

describe 'PATCH update' do
cassette_options = { cassette_name: "checkouts_controller/update" }
describe 'PATCH update', vcr: cassette_options do
subject(:patch_update) { patch :update, params }

let(:params) do
Expand Down
72 changes: 72 additions & 0 deletions spec/fixtures/cassettes/checkouts_controller/update.yml

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

0 comments on commit 15f0fb8

Please sign in to comment.