-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger new backorder only when user checks out
When an admin creates an order, then AmendBackorderJob is called which can also trigger a new backorder if needed. This means that we are not creating backorders via subscriptions any more. It has never been requested and we can bring that back if needed.
- Loading branch information
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require "system_helper" | ||
|
||
RSpec.describe "Checkout" do | ||
include ShopWorkflow | ||
include CheckoutHelper | ||
|
||
let(:variant) { order.variants.first } | ||
let(:order) { create(:order_ready_for_confirmation) } | ||
|
||
before do | ||
variant.semantic_links << SemanticLink.new(semantic_id: "https://product") | ||
set_order order | ||
login_as create(:user) | ||
end | ||
|
||
it "triggers a backorder" do | ||
visit checkout_step_path(:summary) | ||
|
||
expect { place_order }.to enqueue_job BackorderJob | ||
end | ||
end |