From cc2498bb9bae1f514217aa8686b6cc7d02bbb0b4 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sat, 24 May 2014 18:26:02 +1000 Subject: [PATCH] Fix spec fails - group buy and available on removed from new product form --- spec/features/admin/bulk_product_update_spec.rb | 2 -- spec/features/admin/products_spec.rb | 15 ++++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index 7174da9758..d89280df80 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -236,9 +236,7 @@ feature %q{ fill_in 'product_name', :with => 'Big Bag Of Apples' select(s.name, :from => 'product_supplier_id') - choose('product_group_buy_0') fill_in 'product_price', :with => '10.00' - fill_in 'product_available_on', :with => Date.today.strftime("%Y/%m/%d") click_button 'Create' URI.parse(current_url).path.should == '/admin/products/bulk_edit' diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index b9f9d7a206..efe531224d 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -46,23 +46,20 @@ feature %q{ product.product_distributions.map { |pd| pd.enterprise_fee }.sort.should == [@enterprise_fees[0], @enterprise_fees[2]].sort end + scenario "making a product into a group buy product" do + product = create(:simple_product, name: 'group buy product') - scenario "creating a group buy product" do login_to_admin_section - click_link 'Products' - click_link 'New Product' + visit spree.edit_admin_product_path(product) - fill_in 'product_name', :with => 'A new product !!!' - fill_in 'product_price', :with => '19.99' - select 'New supplier', :from => 'product_supplier_id' choose 'product_group_buy_1' fill_in 'Group buy unit size', :with => '10' - click_button 'Create' + click_button 'Update' - flash_message.should == 'Product "A new product !!!" has been successfully created!' - product = Spree::Product.find_by_name('A new product !!!') + flash_message.should == 'Product "group buy product" has been successfully updated!' + product.reload product.group_buy.should be_true product.group_buy_unit_size.should == 10.0 end