From 6162a5492367eee6c05b3eb04ba3e306522c9363 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Sat, 25 Nov 2017 22:17:00 +0100 Subject: [PATCH] Convert tiered promotion calculator buttons to anchors Buttons block the surrounding form from being submitted by enter key. Instead the enter key leads to tiers being added. Using anchors instead. --- .../promotions/calculators/tiered_flat_rate/_fields.html.erb | 2 +- .../promotions/calculators/tiered_percent/_fields.html.erb | 2 +- .../spec/features/admin/promotions/tiered_calculator_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb b/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb index 396e727d2ea..f19d927f29a 100644 --- a/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +++ b/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb @@ -25,6 +25,6 @@ 'form-prefix' => prefix, 'calculator' => 'tiered_flat_rate' } %> - + <%= t('spree.actions.add') %> diff --git a/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb b/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb index be7fd391db1..ff6bb6797b8 100644 --- a/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +++ b/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb @@ -25,6 +25,6 @@ 'form-prefix' => prefix, 'calculator' => 'tiered_percent' } %> - + <%= t('spree.actions.add') %> diff --git a/backend/spec/features/admin/promotions/tiered_calculator_spec.rb b/backend/spec/features/admin/promotions/tiered_calculator_spec.rb index 23fa08b33a5..aa96b391a49 100644 --- a/backend/spec/features/admin/promotions/tiered_calculator_spec.rb +++ b/backend/spec/features/admin/promotions/tiered_calculator_spec.rb @@ -20,7 +20,7 @@ expect(page).to have_content("Base Percent") expect(page).to have_content("Tiers") - click_button "Add" + page.find('a.button').click end fill_in "Base Percent", with: 5