Merge pull request #6627 from Matt-Yorkley/dead-code-product-available

Delete dead code Spree::Product#available?
This commit is contained in:
Pau Pérez Fabregat
2021-01-08 17:35:21 +01:00
committed by GitHub
2 changed files with 0 additions and 19 deletions

View File

@@ -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)

View File

@@ -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