Skip to content
This repository
Browse code

Remove sign up spec from promotion adjustments and switch over from u…

…sing sign_in_as! now that auth is gone
  • Loading branch information...
commit 575867888fe53371ace9a885a76d336b4a02b6fc 1 parent f07c264
Ryan Bigg authored May 10, 2012
54  promo/spec/requests/promotion_adjustments_spec.rb
@@ -429,7 +429,6 @@
429 429
       Spree::Order.last.total.to_f.should == 49.00
430 430
     end
431 431
 
432  
-
433 432
     def create_per_product_promotion product_name, discount_amount
434 433
       visit spree.admin_path
435 434
       click_link "Promotions"
@@ -482,58 +481,5 @@ def do_checkout
482 481
       fill_in "card_code", :with => "123"
483 482
       click_button "Save and Continue"
484 483
     end
485  
-
486  
-    def create_per_product_promotion product_name, discount_amount
487  
-      visit spree.admin_path
488  
-      click_link "Promotions"
489  
-      click_link "New Promotion"
490  
-      fill_in "Name", :with => "Bundle"
491  
-      select "Add to cart", :from => "Event"
492  
-      click_button "Create"
493  
-      page.should have_content("Editing Promotion")
494  
-
495  
-      # add product_name to last promotion
496  
-      promotion = Spree::Promotion.last
497  
-      promotion.rules << Spree::Promotion::Rules::Product.new()
498  
-      product = Spree::Product.find_by_name(product_name)
499  
-      rule = promotion.rules.last
500  
-      rule.products << product
501  
-      if rule.save
502  
-        puts "Created promotion: new price for #{product_name} is #{product.price - discount_amount} (was #{product.price})"
503  
-      else
504  
-        puts "Failed to create promotion: price for #{product_name} is still #{product.price}"
505  
-      end
506  
-
507  
-      select "Create adjustment", :from => "Add action of type"
508  
-      within('#action_fields') { click_button "Add" }
509  
-      select "Flat Rate (per item)", :from => "Calculator"
510  
-      within('#actions_container') { click_button "Update" }
511  
-      within('.calculator-fields') { fill_in "Amount", :with => discount_amount.to_s }
512  
-      within('#actions_container') { click_button "Update" }
513  
-    end
514  
-  
515  
-    def add_to_cart product_name
516  
-      visit spree.root_path
517  
-      click_link product_name
518  
-      click_button "Add To Cart"
519  
-    end
520  
-
521  
-    def do_checkout
522  
-      click_link "Checkout"
523  
-      str_addr = "bill_address"
524  
-      select "United States", :from => "order_#{str_addr}_attributes_country_id"
525  
-      ['firstname', 'lastname', 'address1', 'city', 'zipcode', 'phone'].each do |field|
526  
-        fill_in "order_#{str_addr}_attributes_#{field}", :with => "#{address.send(field)}"
527  
-      end
528  
-      select "#{address.state.name}", :from => "order_#{str_addr}_attributes_state_id"
529  
-      check "order_use_billing"
530  
-      click_button "Save and Continue"
531  
-      click_button "Save and Continue"
532  
-      choose('Credit Card')
533  
-      fill_in "card_number", :with => "4111111111111111"
534  
-      fill_in "card_code", :with => "123"
535  
-      click_button "Save and Continue"
536  
-    end
537  
-
538 484
   end
539 485
 end

0 notes on commit 5758678

Please sign in to comment.
Something went wrong with that request. Please try again.