mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix specs: feature specs requiring payment and shipping methods, race condition, double flash message issue
This commit is contained in:
@@ -95,7 +95,7 @@ feature %q{
|
||||
# click the 'capture' link for the order
|
||||
page.find("[data-action=capture][href*=#{@order.number}]").click
|
||||
|
||||
flash_message.should == "Payment Updated"
|
||||
page.should have_content "Payment Updated"
|
||||
|
||||
# check the order was captured
|
||||
@order.reload
|
||||
|
||||
@@ -171,11 +171,10 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
fill_in "variants[#{variant.id}]", with: 6
|
||||
fill_in "variant_attributes[#{variant.id}][max_quantity]", with: 7
|
||||
page.should have_in_cart product.name
|
||||
|
||||
wait_until { !cart_dirty }
|
||||
|
||||
li = Spree::Order.order(:created_at).last.line_items.order(:created_at).last
|
||||
while li == nil
|
||||
sleep 0.1
|
||||
li = Spree::Order.order(:created_at).last.line_items.order(:created_at).last
|
||||
end
|
||||
li.max_quantity.should == 7
|
||||
li.quantity.should == 6
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ describe "Shop API" do
|
||||
include ShopWorkflow
|
||||
|
||||
describe "filtering products" do
|
||||
let(:distributor) { create(:distributor_enterprise) }
|
||||
let(:distributor) { create(:distributor_enterprise, with_payment_and_shipping: true) }
|
||||
let(:supplier) { create(:supplier_enterprise) }
|
||||
let(:oc1) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise), orders_close_at: 2.days.from_now) }
|
||||
let(:p1) { create(:simple_product, on_demand: false) }
|
||||
|
||||
Reference in New Issue
Block a user