mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove unused method enterprise method
`Enterprise.has_supplied_products_on_hand?` is not used anywhere.
This commit is contained in:
@@ -193,10 +193,6 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def has_supplied_products_on_hand?
|
||||
self.supplied_products.where('count_on_hand > 0').present?
|
||||
end
|
||||
|
||||
def to_param
|
||||
permalink
|
||||
end
|
||||
|
||||
@@ -489,26 +489,6 @@ describe Enterprise do
|
||||
end
|
||||
end
|
||||
|
||||
describe "has_supplied_products_on_hand?" do
|
||||
before :each do
|
||||
@supplier = create(:supplier_enterprise)
|
||||
end
|
||||
|
||||
it "returns false when no products" do
|
||||
@supplier.should_not have_supplied_products_on_hand
|
||||
end
|
||||
|
||||
it "returns false when the product is out of stock" do
|
||||
create(:product, :supplier => @supplier, :on_hand => 0)
|
||||
@supplier.should_not have_supplied_products_on_hand
|
||||
end
|
||||
|
||||
it "returns true when the product is in stock" do
|
||||
create(:product, :supplier => @supplier, :on_hand => 1)
|
||||
@supplier.should have_supplied_products_on_hand
|
||||
end
|
||||
end
|
||||
|
||||
describe "finding variants distributed by the enterprise" do
|
||||
it "finds master and other variants" do
|
||||
d = create(:distributor_enterprise)
|
||||
|
||||
Reference in New Issue
Block a user