diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0d8f209ce2..d04bbcc8d8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base sidebar_distributors_limit = 5 #set false to disable TODO: move to app config sidebar_suppliers_limit = 5 @sidebar_distributors = Enterprise.is_distributor.with_distributed_active_products_on_hand.by_name.limit(sidebar_distributors_limit) - @total_distributors = Enterprise.is_distributor.with_distributed_active_products_on_hand.by_name.distinct_count + @total_distributors = Enterprise.is_distributor.with_distributed_active_products_on_hand.distinct_count @sidebar_suppliers = Enterprise.is_primary_producer.with_supplied_active_products_on_hand.limit(sidebar_suppliers_limit) @total_suppliers = Enterprise.is_primary_producer.with_supplied_active_products_on_hand.distinct_count end diff --git a/spec/features/consumer/distributors_spec.rb b/spec/features/consumer/distributors_spec.rb index 0f0ce829ea..4a75a8d8cc 100644 --- a/spec/features/consumer/distributors_spec.rb +++ b/spec/features/consumer/distributors_spec.rb @@ -48,7 +48,7 @@ scenario "viewing a list of distributors (with active products) in the sidebar w page.should_not have_selector 'a', :text => d3.name #has no products on hand # And I shouldn't see 'xx more' - page.should_not have_selector '#distributor_filter span.filter_more', :text => 'more' + page.should_not have_selector '#distributor_filter span.filter_more' # And I shouldn't see a browse distributors button page.should have_selector "#distributor_filter input[value='Browse All Distributors']" diff --git a/spec/features/consumer/suppliers_spec.rb b/spec/features/consumer/suppliers_spec.rb index 6abc642aac..c48cae9d13 100644 --- a/spec/features/consumer/suppliers_spec.rb +++ b/spec/features/consumer/suppliers_spec.rb @@ -30,7 +30,7 @@ feature %q{ page.should_not have_selector 'a', :text => s3.name #has no products on hand # And I shouldn't see 'xx more' - page.should_not have_selector '#supplier_filter span.filter_more', :text => 'more' + page.should_not have_selector '#supplier_filter span.filter_more' # And I shouldn't see a browse suppliers button page.should have_selector "#supplier_filter input[value='Browse All Suppliers']"