mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix payment not being captured due to being to small to cover order's distribution fee
This commit is contained in:
@@ -110,6 +110,7 @@ FactoryGirl.define do
|
||||
after(:create) do |order|
|
||||
p = create(:simple_product, :distributors => [order.distributor])
|
||||
FactoryGirl.create(:line_item, :order => order, :product => p)
|
||||
order.reload
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,13 +12,15 @@ feature %q{
|
||||
@order = create(:order_with_totals_and_distributor, :user => @user, :state => 'complete', :payment_state => 'balance_due')
|
||||
|
||||
# ensure order has a payment to capture
|
||||
create :check_payment, order: @order, amount: @order.amount
|
||||
distribution_fee = 1
|
||||
create :check_payment, order: @order, amount: (@order.amount + distribution_fee)
|
||||
@order.finalize!
|
||||
end
|
||||
|
||||
context "managing orders" do
|
||||
scenario "capture multiple payments from the orders index page" do
|
||||
# d.cook: could also test for an order that has had payment voided, then a new check payment created but not yet captured. But it's not critical and I know it works anyway.
|
||||
|
||||
login_to_admin_section
|
||||
|
||||
click_link 'Orders'
|
||||
|
||||
Reference in New Issue
Block a user