mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Checkout won't load without payment and shipping methods; move spec to context where it can test the checkout
This commit is contained in:
@@ -108,7 +108,7 @@ feature %q{
|
||||
page.should have_content 'Payment State'
|
||||
end
|
||||
|
||||
describe "Sales tax report" do
|
||||
describe "sales tax report" do
|
||||
let(:distributor1) { create(:distributor_enterprise, with_payment_and_shipping: true) }
|
||||
let(:distributor2) { create(:distributor_enterprise, with_payment_and_shipping: true) }
|
||||
let(:user1) { create_enterprise_user enterprises: [distributor1] }
|
||||
|
||||
@@ -21,11 +21,6 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
add_product_to_cart
|
||||
end
|
||||
|
||||
it "shows the current distributor on checkout" do
|
||||
visit checkout_path
|
||||
page.should have_content distributor.name
|
||||
end
|
||||
|
||||
describe "with shipping and payment methods" do
|
||||
let(:sm1) { create(:shipping_method, require_ship_address: true, name: "Frogs", description: "yellow", calculator: Spree::Calculator::FlatRate.new(preferred_amount: 0.00)) }
|
||||
let(:sm2) { create(:shipping_method, require_ship_address: false, name: "Donkeys", description: "blue", calculator: Spree::Calculator::FlatRate.new(preferred_amount: 4.56)) }
|
||||
@@ -50,6 +45,11 @@ feature "As a consumer I want to check out my cart", js: true do
|
||||
checkout_as_guest
|
||||
end
|
||||
|
||||
it "shows the current distributor" do
|
||||
visit checkout_path
|
||||
page.should have_content distributor.name
|
||||
end
|
||||
|
||||
it "shows a breakdown of the order price" do
|
||||
toggle_shipping
|
||||
choose sm2.name
|
||||
|
||||
Reference in New Issue
Block a user