Remove commented out code, clean up comments and style

This commit is contained in:
Rohan Mitchell
2013-07-23 16:51:22 +10:00
parent 1dd92d0133
commit d83e8cb3ba
3 changed files with 7 additions and 17 deletions

View File

@@ -1,14 +1,8 @@
# When a user fires an event, take them back to where they came from
#Responder: http://guides.spreecommerce.com/developer/logic.html#overriding-controller-action-responses
# Responder: http://guides.spreecommerce.com/developer/logic.html#overriding-controller-action-responses
Spree::Admin::PaymentsController.class_eval do
respond_override :fire => { :html => { :success => lambda {
redirect_to request.referer #keeps any filter and sort prefs
#if request.referrer.path_parameters['controller'] == spree.admin_orders_path
# redirect_to spree.admin_orders_path
#else
# redirect_to spree.admin_order_payments_path(@order) #default action
#end
redirect_to request.referer # Keeps any filter and sort prefs
} } }
end

View File

@@ -84,8 +84,8 @@ FactoryGirl.define do
after(:create) { |c| c.set_preference(:per_kg, 0.5); c.save! }
end
#Ensure order has a distributor set
factory :order_with_totals_and_distributor, :parent => :order do #possibly called :order_with_line_items in newer Spree
# Ensure order has a distributor set
distributor { create(:distributor_enterprise) }
after(:create) do |order|
p = create(:simple_product, :distributors => [order.distributor])

View File

@@ -13,8 +13,6 @@ feature %q{
# ensure order has a payment to capture
create :check_payment, order: @order, amount: @order.amount
# ensure order shows up as completed
@order.finalize!
end
@@ -29,16 +27,14 @@ feature %q{
# click the 'capture' link for the order
page.find("[data-action=capture][href*=#{@order.number}]").click
# we should be notified
flash_message.should == "Payment Updated"
# check the order was captured
@order.reload
@order.payment_state.should == "paid"
# we should still be on the right page
# we should still be on the same page
current_path.should == spree.admin_orders_path
end # scenario
end # context
end #f eature
end
end
end