Fix specs: feature specs requiring payment and shipping methods, race condition, double flash message issue

This commit is contained in:
Rohan Mitchell
2014-11-01 12:11:50 +11:00
parent 15b05de7f2
commit 8c2adb2a05
3 changed files with 5 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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) }