mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Merge pull request #6627 from Matt-Yorkley/dead-code-product-available
Delete dead code Spree::Product#available?
This commit is contained in:
@@ -274,10 +274,6 @@ module Spree
|
||||
!!deleted_at
|
||||
end
|
||||
|
||||
def available?
|
||||
!(available_on.nil? || available_on.future?)
|
||||
end
|
||||
|
||||
# split variants list into hash which shows mapping of opt value onto matching variants
|
||||
# eg categorise_variants_from_option(color) => {"red" -> [...], "blue" -> [...]}
|
||||
def categorise_variants_from_option(opt_type)
|
||||
|
||||
@@ -85,21 +85,6 @@ module Spree
|
||||
end
|
||||
end
|
||||
|
||||
context "#available?" do
|
||||
it "should be available if date is in the past" do
|
||||
product.available_on = 1.day.ago
|
||||
expect(product).to be_available
|
||||
end
|
||||
|
||||
it "should not be available if date is nil or in the future" do
|
||||
product.available_on = nil
|
||||
expect(product).to_not be_available
|
||||
|
||||
product.available_on = 1.day.from_now
|
||||
expect(product).to_not be_available
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Variants sorting' do
|
||||
context 'without master variant' do
|
||||
it 'sorts variants by position' do
|
||||
|
||||
Reference in New Issue
Block a user