From 97a79a77e100ef89439bfeb42a86932d83e4aa1e Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Fri, 8 Oct 2021 14:29:41 +0100 Subject: [PATCH 1/5] Updates/moves consumer/account/cards_spec into system --- spec/{features => system}/consumer/account/cards_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename spec/{features => system}/consumer/account/cards_spec.rb (98%) diff --git a/spec/features/consumer/account/cards_spec.rb b/spec/system/consumer/account/cards_spec.rb similarity index 98% rename from spec/features/consumer/account/cards_spec.rb rename to spec/system/consumer/account/cards_spec.rb index 55573be384f..544b8577151 100644 --- a/spec/features/consumer/account/cards_spec.rb +++ b/spec/system/consumer/account/cards_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe "Credit Cards", js: true do include AuthenticationHelper @@ -64,7 +64,6 @@ # Allows switching of default card within(".card#card#{non_default_card.id}") do find_field('default_card').click - accept_alert expect(find_field('default_card')).to be_checked end From acc0cc08c3baa2e32d09d84aff5a0f4ebfb9586f Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Fri, 8 Oct 2021 14:31:03 +0100 Subject: [PATCH 2/5] Updates/moves consumer/account/payments_spec into system --- spec/{features => system}/consumer/account/payments_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{features => system}/consumer/account/payments_spec.rb (100%) diff --git a/spec/features/consumer/account/payments_spec.rb b/spec/system/consumer/account/payments_spec.rb similarity index 100% rename from spec/features/consumer/account/payments_spec.rb rename to spec/system/consumer/account/payments_spec.rb From 75f773fafc56d99b3ce857385408483bf339b171 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Fri, 8 Oct 2021 14:36:54 +0100 Subject: [PATCH 3/5] Updates/moves consumer/account/settings_spec into system --- spec/system/consumer/account/payments_spec.rb | 2 +- spec/{features => system}/consumer/account/settings_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename spec/{features => system}/consumer/account/settings_spec.rb (98%) diff --git a/spec/system/consumer/account/payments_spec.rb b/spec/system/consumer/account/payments_spec.rb index 8310d9e7d18..6553d0c08c1 100644 --- a/spec/system/consumer/account/payments_spec.rb +++ b/spec/system/consumer/account/payments_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe "Payments requiring action", js: true do include AuthenticationHelper diff --git a/spec/features/consumer/account/settings_spec.rb b/spec/system/consumer/account/settings_spec.rb similarity index 98% rename from spec/features/consumer/account/settings_spec.rb rename to spec/system/consumer/account/settings_spec.rb index 9ba6bcee0e6..5607d280ba3 100644 --- a/spec/features/consumer/account/settings_spec.rb +++ b/spec/system/consumer/account/settings_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe "Account Settings", js: true do include AuthenticationHelper From b00811673492cc90950856b5d1fc275c9420e8c5 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 11 Oct 2021 16:41:52 +1100 Subject: [PATCH 4/5] Cover alert text in spec The `strip` method removes a trailing newline at the end. --- spec/system/consumer/account/cards_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/system/consumer/account/cards_spec.rb b/spec/system/consumer/account/cards_spec.rb index 544b8577151..a736668f490 100644 --- a/spec/system/consumer/account/cards_spec.rb +++ b/spec/system/consumer/account/cards_spec.rb @@ -62,8 +62,15 @@ end # Allows switching of default card + alert_text = <<~TEXT.strip + Changing your default card will remove shops' existing authorizations \ + to charge it. You can re-authorize shops after updating the default \ + card. Do you wish to change the default card?" + TEXT within(".card#card#{non_default_card.id}") do - find_field('default_card').click + accept_alert(alert_text) do + find_field('default_card').click + end expect(find_field('default_card')).to be_checked end From 35ed7e852d4827747e718fbd03325dd4fef4b348 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 11 Oct 2021 16:43:14 +1100 Subject: [PATCH 5/5] Remove errornous quotes from alert text --- config/locales/en.yml | 2 +- spec/system/consumer/account/cards_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 562227021af..76398dceefe 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2711,7 +2711,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using resolve_errors: Please resolve the following errors more_items: "+ %{count} More" default_card_updated: Default Card Updated - default_card_voids_auth: Changing your default card will remove shops' existing authorizations to charge it. You can re-authorize shops after updating the default card. Do you wish to change the default card?" + default_card_voids_auth: Changing your default card will remove shops' existing authorizations to charge it. You can re-authorize shops after updating the default card. Do you wish to change the default card? cart: add_to_cart_failed: > There was a problem adding this product to the cart. diff --git a/spec/system/consumer/account/cards_spec.rb b/spec/system/consumer/account/cards_spec.rb index a736668f490..91ce8427c88 100644 --- a/spec/system/consumer/account/cards_spec.rb +++ b/spec/system/consumer/account/cards_spec.rb @@ -65,7 +65,7 @@ alert_text = <<~TEXT.strip Changing your default card will remove shops' existing authorizations \ to charge it. You can re-authorize shops after updating the default \ - card. Do you wish to change the default card?" + card. Do you wish to change the default card? TEXT within(".card#card#{non_default_card.id}") do accept_alert(alert_text) do