Fix spec fails - group buy and available on removed from new product form

This commit is contained in:
Rohan Mitchell
2014-05-24 18:26:02 +10:00
parent 403e957111
commit cc2498bb9b
2 changed files with 6 additions and 11 deletions

View File

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

View File

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