Remove unused helper

This commit is contained in:
Gaetan Craig-Riou
2026-02-18 14:41:56 +11:00
parent c0823d24c2
commit 5e4cd4d51d
4 changed files with 0 additions and 49 deletions

View File

@@ -83,31 +83,6 @@ module CheckoutHelper
Spree::Money.new order.total - order.total_tax, currency: order.currency
end
def validated_input(name, path, args = {})
attributes = {
:required => true,
:type => :text,
:name => path,
:id => path,
"ng-model" => path,
"ng-class" => "{error: !fieldValid('#{path}')}"
}.merge args
render "shared/validated_input", name:, path:, attributes:
end
def validated_select(name, path, options, args = {})
attributes = {
:required => true,
:id => path,
"ng-model" => path,
"ng-class" => "{error: !fieldValid('#{path}')}"
}.merge args
render "shared/validated_select", name:, path:, options:,
attributes:
end
def payment_method_price(method, order)
price = method.compute_amount(order)
if price == 0

View File

@@ -1,6 +0,0 @@
%label{for: path}= name
%input.medium.input-text{attributes}
%small.error.medium.input-text{"ng-show" => "!fieldValid('#{path}')"}
= "{{ fieldErrors('#{path}') }}"

View File

@@ -1,6 +0,0 @@
%label{for: path}= name
= select_tag path, options_for_select(options), attributes
%small.error.medium.input-text{"ng-show" => "!fieldValid('#{path}')"}
= "{{ fieldErrors('#{path}') }}"

View File

@@ -1,18 +1,6 @@
# frozen_string_literal: true
RSpec.describe CheckoutHelper do
it "generates html for validated inputs" do
expect(helper).to receive(:render).with(
"shared/validated_input",
name: "test",
path: "foo",
attributes: { :required => true, :type => :email, :name => "foo", :id => "foo",
"ng-model" => "foo", "ng-class" => "{error: !fieldValid('foo')}" }
)
helper.validated_input("test", "foo", type: :email)
end
describe "#display_checkout_tax_total" do
subject(:display_checkout_tax_total) { helper.display_checkout_tax_total(order) }