diff --git a/doc/outstanding_shopping_tests b/doc/outstanding_shopping_tests index 3d8974fb1c..4bfcc0c2aa 100644 --- a/doc/outstanding_shopping_tests +++ b/doc/outstanding_shopping_tests @@ -13,15 +13,6 @@ Shop: scenario "order cycle expires mid-order" (see below) it "does not allow the user to add a product from a distributor that cannot supply the cart's products" - - add_to_cart_spec: - AFTER DONE remove add_to_cart spec - MOVE to shopping_group_buy_spec.rb - adapt: scenario "adding a product to the cart for a group buy" - adapt: scenario "adding a product with variants to the cart for a group buy" - adapt: scenario "adding a product to cart that is not a group buy does not show max quantity field" do - adapt: scenario "adding a product with a max quantity less than quantity results in max_quantity==quantity" do - scenario "order cycle expires mid-order" do diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index e6cb8c5d0c..67150f3f62 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -233,6 +233,7 @@ feature "As a consumer I want to shop with a distributor", js: true do describe "group buy products" do let(:oc) { create(:simple_order_cycle, distributors: [distributor]) } let(:product) { create(:simple_product, group_buy: true, on_hand: 15) } + let(:product2) { create(:simple_product, group_buy: false) } describe "without variants" do before do @@ -241,6 +242,7 @@ feature "As a consumer I want to shop with a distributor", js: true do it "should show group buy input" do page.should have_field "variant_attributes[#{product.master.id}][max_quantity]", :visible => true + page.should_not have_field "variant_attributes[#{product2.master.id}][max_quantity]", :visible => true end it "should save group buy data to ze cart" do @@ -252,6 +254,16 @@ feature "As a consumer I want to shop with a distributor", js: true do li.max_quantity.should == 9 li.quantity.should == 5 end + + scenario "adding a product with a max quantity less than quantity results in max_quantity==quantity" do + fill_in "variants[#{product.master.id}]", with: 5 + fill_in "variant_attributes[#{product.master.id}][max_quantity]", with: 1 + first("form.custom > input.button.right").click + page.should have_content product.name + li = Spree::Order.order(:created_at).last.line_items.order(:created_at).last + li.max_quantity.should == 5 + li.quantity.should == 5 + end end describe "with variants on the product" do