mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-09 03:20:21 +00:00
Adds spec on open order information
This commit is contained in:
committed by
Jean-Baptiste Bellet
parent
6f6ad05ac2
commit
790bcc9ff2
@@ -505,7 +505,10 @@ describe "As a consumer, I want to checkout my order", js: true do
|
||||
end
|
||||
|
||||
context "summary step" do
|
||||
let(:order) { create(:order_ready_for_confirmation, distributor: distributor) }
|
||||
let(:order) {
|
||||
create(:order_ready_for_confirmation, distributor: distributor,
|
||||
order_cycle: order_cycle, user_id: user.id)
|
||||
}
|
||||
|
||||
describe "completing the checkout" do
|
||||
it "keeps the distributor selected for the current user after completion" do
|
||||
@@ -667,6 +670,23 @@ describe "As a consumer, I want to checkout my order", js: true do
|
||||
expect(page).to have_current_path checkout_step_path(:payment)
|
||||
end
|
||||
end
|
||||
|
||||
context "with previous open orders" do
|
||||
let!(:prev_order) {
|
||||
create(:completed_order_with_totals,
|
||||
order_cycle: order_cycle, distributor: distributor, user_id: order.user_id)
|
||||
}
|
||||
|
||||
before do
|
||||
order.distributor.allow_order_changes = true
|
||||
order.distributor.save
|
||||
end
|
||||
|
||||
it "informs about previous orders" do
|
||||
pending("issue #9007")
|
||||
expect(page).to have_content("You have an order for this order cycle already.")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user