diff --git a/lib/spree/localized_number.rb b/lib/spree/localized_number.rb index a1ba18accd..05cc7e7e2e 100644 --- a/lib/spree/localized_number.rb +++ b/lib/spree/localized_number.rb @@ -45,7 +45,7 @@ module Spree def self.valid_localizable_number?(number) return true unless number.is_a?(String) || number.respond_to?(:to_d) # Invalid if only two digits between dividers, or if any non-number characters - return false if number.to_s =~ /[.,]\d{2}[.,]/ || number.to_s =~ /[^0-9,.]+/ + return false if number.to_s =~ /[.,]\d{2}[.,]/ || number.to_s =~ /[^0-9,.-]+/ true end diff --git a/spec/system/admin/adjustments_spec.rb b/spec/system/admin/adjustments_spec.rb index 688377a285..bb94ce013f 100644 --- a/spec/system/admin/adjustments_spec.rb +++ b/spec/system/admin/adjustments_spec.rb @@ -63,23 +63,17 @@ describe ' context "included tax" do context "adding negative, taxed adjustments to an order" do - it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%", "$0.33", "$-1.67" do - before { pending("#10837") } - end + it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%", "$0.33", "$-1.67" end context "adding positive, taxed adjustments to an order" do - it_behaves_like "when the enable_localized_number preference", "Late fee", "100", "TVA 20%", "$-16.67", "$83.33" do - before { pending("#10837") } - end + it_behaves_like "when the enable_localized_number preference", "Late fee", "100", "TVA 20%", "$-16.67", "$83.33" end end context "added tax" do context "adding negative, taxed adjustments to an order" do - it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST", "$10.00", "$8.00" do - before { pending("#10837") } - end + it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST", "$10.00", "$8.00" end context "adding positive, taxed adjustments to an order" do