mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
update units list on Spree::Admin::GeneralSettingsHelper#all_units
added a test to make sure that all units on WeightsAndMeasures::UNITS are list on all_units
This commit is contained in:
@@ -4,7 +4,12 @@ module Spree
|
||||
module Admin
|
||||
module GeneralSettingsHelper
|
||||
def all_units
|
||||
["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
|
||||
[
|
||||
"mg", "g", "kg", "T",
|
||||
"oz", "lb",
|
||||
"mL", "cL", "dL", "L", "kL",
|
||||
"gal"
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -90,4 +90,12 @@ describe WeightsAndMeasures do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "UNITS" do
|
||||
include Spree::Admin::GeneralSettingsHelper
|
||||
it "should include all the available untis" do
|
||||
units = WeightsAndMeasures::UNITS.values.flat_map(&:values).pluck("name").sort.uniq
|
||||
expect(units).to eq(all_units.sort.uniq)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user