Fix stripe request spec by providing en enterprise_id

The enterprise_id is used to lookup a StripeAccount which is provided to the Spree::Token#create call in the StripeConnect gateway
This commit is contained in:
Rob Harrington
2017-07-14 18:21:32 +10:00
parent 44ba499ad9
commit ee92f46bd5
2 changed files with 6 additions and 1 deletions

View File

@@ -363,6 +363,11 @@ FactoryGirl.define do
end
end
factory :stripe_payment_method, :class => Spree::Gateway::StripeConnect do
name 'Stripe'
environment 'test'
end
factory :stripe_account do
enterprise { FactoryGirl.create :distributor_enterprise }
stripe_user_id "abc123"

View File

@@ -8,7 +8,7 @@ describe "Submitting Stripe Connect charge requests", type: :request do
let!(:enterprise) { create(:distributor_enterprise) }
let!(:exchange) { create(:exchange, order_cycle: order_cycle, sender: order_cycle.coordinator, receiver: enterprise, incoming: false, pickup_time: "Monday") }
let!(:shipping_method) { create(:shipping_method, calculator: Spree::Calculator::FlatRate.new(preferred_amount: 0), distributors: [enterprise]) }
let!(:payment_method) { create(:payment_method, type: "Spree::Gateway::StripeConnect", distributors: [enterprise]) }
let!(:payment_method) { create(:stripe_payment_method, distributors: [enterprise], preferred_enterprise_id: enterprise.id) }
let!(:stripe_account) { create(:stripe_account, enterprise: enterprise) }
let!(:line_item) { create(:line_item, price: 12.34) }
let!(:order) { line_item.order }