Checkout won't load without payment and shipping methods; move spec to context where it can test the checkout

This commit is contained in:
Rohan Mitchell
2015-04-02 11:22:12 +11:00
parent e75c6a8e1d
commit 210c76eddc
2 changed files with 6 additions and 6 deletions

View File

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

View File

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