Merge pull request #11290 from cyrillefr/Orders_in_confirmation_state_cannot_be_completed_by_hub_or_shop

Fix Orders in confirmation state cannot be completed by hub or shop
This commit is contained in:
Filipe
2023-11-16 19:50:14 +00:00
committed by GitHub
13 changed files with 49 additions and 12 deletions

View File

@@ -28,14 +28,14 @@ module Spree
it "should be true if payment is pending" do
payment = build_stubbed(:payment, created_at: Time.zone.now)
allow(payment).to receive(:pending?) { true }
expect(credit_card.can_capture?(payment)).to be_truthy
expect(credit_card.can_capture_and_complete_order?(payment)).to be_truthy
end
it "should be true if payment is checkout" do
payment = build_stubbed(:payment, created_at: Time.zone.now)
allow(payment).to receive_messages pending?: false,
checkout?: true
expect(credit_card.can_capture?(payment)).to be_truthy
expect(credit_card.can_capture_and_complete_order?(payment)).to be_truthy
end
end

View File

@@ -889,7 +889,7 @@ describe Spree::Payment do
let(:payment) { build_stubbed(:payment, source: build_stubbed(:credit_card)) }
it "can capture and void" do
expect(payment.actions).to match_array %w(capture void)
expect(payment.actions).to match_array %w(capture_and_complete_order void)
end
describe "when a payment has been taken" do