From 7aefa05efd2c6c9b5a3200b66e78413531ca776d Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 31 Oct 2014 14:48:08 +1100 Subject: [PATCH] Fix specs broken by requirement for valid shipping and payment method --- spec/features/consumer/home_spec.rb | 2 ++ spec/features/consumer/shopping/shopping_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/spec/features/consumer/home_spec.rb b/spec/features/consumer/home_spec.rb index dd39dc937d..56739187a0 100644 --- a/spec/features/consumer/home_spec.rb +++ b/spec/features/consumer/home_spec.rb @@ -5,6 +5,8 @@ feature 'Home', js: true do include UIComponentHelper let!(:distributor) { create(:distributor_enterprise) } + let!(:shipping_method) { create(:shipping_method, distributors: [distributor]) } + let!(:payment_method) { create(:payment_method, distributors: [distributor]) } let!(:invisible_distributor) { create(:distributor_enterprise, visible: false) } let(:d1) { create(:distributor_enterprise) } let(:d2) { create(:distributor_enterprise) } diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index d4db6bff29..b9b2a21219 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -10,6 +10,8 @@ feature "As a consumer I want to shop with a distributor", js: true do let(:distributor) { create(:distributor_enterprise) } let(:supplier) { create(:supplier_enterprise) } + let(:shipping_method) { create(:shipping_method, distributors: [distributor]) } + let(:payment_method) { create(:payment_method, distributors: [distributor]) } let(:oc1) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise), orders_close_at: 2.days.from_now) } let(:oc2) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise), orders_close_at: 3.days.from_now) } let(:product) { create(:simple_product, supplier: supplier) } @@ -64,6 +66,10 @@ feature "As a consumer I want to shop with a distributor", js: true do end it "shows products after selecting an order cycle" do + # Hubs cannot be selected without a valid shipping and payment method + shipping_method + payment_method + product.master.update_attribute(:display_name, "kitten") product.master.update_attribute(:display_as, "rabbit") exchange1.variants << product.master ## add product to exchange