Fix checkout feature specs

This commit is contained in:
Hugo Daniel
2018-11-22 17:01:39 +01:00
parent 064ec7d270
commit d7a148bb75
3 changed files with 6 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ Spree::OrdersController.class_eval do
associate_user
if @order.insufficient_stock_lines.present?
flash[:error] = t(:spree_inventory_error_flash_for_insufficient_quantity)
flash[:error] = t("spree.inventory_error_flash_for_insufficient_quantity")
end
end
end

View File

@@ -2659,6 +2659,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
my_account: "My account"
date: "Date"
time: "Time"
inventory_error_flash_for_insufficient_quantity: "An item in your cart has become unavailable"
errors:
messages:
blank: "can't be blank"

View File

@@ -14,7 +14,7 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
let(:enterprise_fee) { create(:enterprise_fee, amount: 1.23, tax_category: product.tax_category) }
let(:product) { create(:taxed_product, supplier: supplier, price: 10, zone: zone, tax_rate_amount: 0.1) }
let(:variant) { product.variants.first }
let(:order) { create(:order, order_cycle: order_cycle, distributor: distributor) }
let(:order) { create(:order, order_cycle: order_cycle, distributor: distributor, bill_address_id: nil, ship_address_id: nil) }
before do
Spree::Config.shipment_inc_vat = true
@@ -47,6 +47,7 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
describe "when I have an out of stock product in my cart" do
before do
variant.on_demand = false
variant.on_hand = 0
variant.save!
end
@@ -411,6 +412,7 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
end
it "takes us to the cart page with an error when a product becomes out of stock just before we purchase", js: true do
variant.on_demand = false
variant.on_hand = 0
variant.save!
@@ -418,7 +420,7 @@ feature "As a consumer I want to check out my cart", js: true, retry: 3 do
page.should_not have_content "Your order has been processed successfully"
page.should have_selector 'closing', text: "Your shopping cart"
page.should have_content "Out of Stock"
page.should have_content "Out Of Stock"
end
context "when we are charged a shipping fee" do