diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index ac56d20d8f..1599254bbb 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -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 diff --git a/app/views/shared/_validated_input.html.haml b/app/views/shared/_validated_input.html.haml deleted file mode 100644 index 46331333fc..0000000000 --- a/app/views/shared/_validated_input.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%label{for: path}= name - -%input.medium.input-text{attributes} - -%small.error.medium.input-text{"ng-show" => "!fieldValid('#{path}')"} - = "{{ fieldErrors('#{path}') }}" diff --git a/app/views/shared/_validated_select.html.haml b/app/views/shared/_validated_select.html.haml deleted file mode 100644 index 35bdd971b3..0000000000 --- a/app/views/shared/_validated_select.html.haml +++ /dev/null @@ -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}') }}" diff --git a/spec/helpers/checkout_helper_spec.rb b/spec/helpers/checkout_helper_spec.rb index f949a237fc..b14d05e236 100644 --- a/spec/helpers/checkout_helper_spec.rb +++ b/spec/helpers/checkout_helper_spec.rb @@ -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) }