mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove commented out code, clean up comments and style
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user