Test selecting distributor when adding item to cart, for no/remote distributor selected

This commit is contained in:
Rohan Mitchell
2012-06-24 11:41:10 +10:00
parent a91722a593
commit b2f5e23fa4
3 changed files with 31 additions and 9 deletions

View File

@@ -4,15 +4,8 @@ Spree::ProductsController.class_eval do
include Spree::DistributorsHelper
include OpenFoodWeb::SplitProductsByDistributor
before_filter :load_distributors, :only => :show
respond_override :index => { :html => { :success => lambda {
@products, @products_local, @products_remote = split_products_by_distributor @products, current_distributor
} } }
def load_distributors
@distributors = Spree::Distributor.by_name
end
end