mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Remove unused helper
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
%label{for: path}= name
|
||||
|
||||
%input.medium.input-text{attributes}
|
||||
|
||||
%small.error.medium.input-text{"ng-show" => "!fieldValid('#{path}')"}
|
||||
= "{{ fieldErrors('#{path}') }}"
|
||||
@@ -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}') }}"
|
||||
@@ -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) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user