Remove setting the now inexistent global config allow_backorders to false in subs specs because the default value for on_demand (set through stocklocation.backorderabl_default) is false in all specs

This commit is contained in:
luisramos0
2019-01-25 20:26:22 +00:00
parent 216afce6fe
commit bd24d3e27a
2 changed files with 8 additions and 9 deletions

View File

@@ -71,8 +71,6 @@ describe SubscriptionPlacementJob do
let!(:line_item2) { create(:line_item, order: order, variant: variant2, quantity: 3) }
let!(:line_item3) { create(:line_item, order: order, variant: variant3, quantity: 3) }
before { Spree::Config.set(:allow_backorders, false) }
context "when all items are available from the order cycle" do
before { [variant1, variant2, variant3].each { |v| ex.variants << v } }

View File

@@ -1,3 +1,5 @@
require 'spec_helper'
xdescribe SubscriptionForm do
describe "creating a new subscription" do
let!(:shop) { create(:distributor_enterprise) }
@@ -44,7 +46,6 @@ xdescribe SubscriptionForm do
let(:form) { SubscriptionForm.new(subscription, params) }
it "creates orders for each order cycle in the schedule" do
Spree::Config.set allow_backorders: false
expect(form.save).to be true
expect(subscription.proxy_orders.count).to be 2
@@ -61,11 +62,11 @@ xdescribe SubscriptionForm do
proxy_order2 = subscription.proxy_orders.find_by_order_cycle_id(order_cycle2.id)
expect(proxy_order2).to be_a ProxyOrder
order2 = proxy_order2.initialise_order!
expect(order2.line_items.count).to be 3
expect(order2.line_items.count).to eq 3
expect(order2.line_items.find_by_variant_id(variant3.id).quantity).to be 3
expect(order2.shipments.count).to be 1
expect(order2.shipments.count).to eq 1
expect(order2.shipments.first.shipping_method).to eq shipping_method
expect(order2.payments.count).to be 1
expect(order2.payments.count).to eq 1
expect(order2.payments.first.payment_method).to eq payment_method
expect(order2.payments.first.state).to eq 'checkout'
expect(order2.total).to eq 42
@@ -77,11 +78,11 @@ xdescribe SubscriptionForm do
expect(proxy_order3).to be_a ProxyOrder
order3 = proxy_order3.initialise_order!
expect(order3).to be_a Spree::Order
expect(order3.line_items.count).to be 3
expect(order3.line_items.count).to eq 3
expect(order2.line_items.find_by_variant_id(variant3.id).quantity).to be 3
expect(order3.shipments.count).to be 1
expect(order3.shipments.count).to eq 1
expect(order3.shipments.first.shipping_method).to eq shipping_method
expect(order3.payments.count).to be 1
expect(order3.payments.count).to eq 1
expect(order3.payments.first.payment_method).to eq payment_method
expect(order3.payments.first.state).to eq 'checkout'
expect(order3.total).to eq 31.50