From 1ed5f2c24899544acd4a53a7457509a54f201fd8 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 12 Oct 2021 15:24:39 +0100 Subject: [PATCH 1/7] Moves/updates business_address_form_spec into system --- .../admin/enterprises/business_address_form_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{features => system}/admin/enterprises/business_address_form_spec.rb (100%) diff --git a/spec/features/admin/enterprises/business_address_form_spec.rb b/spec/system/admin/enterprises/business_address_form_spec.rb similarity index 100% rename from spec/features/admin/enterprises/business_address_form_spec.rb rename to spec/system/admin/enterprises/business_address_form_spec.rb From 9579783543d9c6552ad7fb4a7b5e658f01c17a64 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 12 Oct 2021 15:26:44 +0100 Subject: [PATCH 2/7] Moves/updates images_spec into system --- spec/{features => system}/admin/enterprises/images_spec.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{features => system}/admin/enterprises/images_spec.rb (100%) diff --git a/spec/features/admin/enterprises/images_spec.rb b/spec/system/admin/enterprises/images_spec.rb similarity index 100% rename from spec/features/admin/enterprises/images_spec.rb rename to spec/system/admin/enterprises/images_spec.rb From f62749e3bff466ef8f052c91a50b9d237550871b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 12 Oct 2021 15:42:44 +0100 Subject: [PATCH 3/7] Wraps alert text in images_spec --- spec/system/admin/enterprises/images_spec.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/enterprises/images_spec.rb b/spec/system/admin/enterprises/images_spec.rb index 89a96f17062..007723124b0 100644 --- a/spec/system/admin/enterprises/images_spec.rb +++ b/spec/system/admin/enterprises/images_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe "Managing enterprise images" do include WebHelper @@ -53,8 +53,12 @@ def go_to_images # Removing image within ".page-admin-enterprises-form__logo-field-group" do - click_on "Remove Image" - accept_js_alert + alert_text = <<~TEXT.strip + The logo will be removed immediately after you confirm. + TEXT + accept_alert(alert_text) do + click_on "Remove Image" + end end expect(page).to have_content("Logo removed successfully") @@ -91,8 +95,12 @@ def go_to_images # Removing image within ".page-admin-enterprises-form__promo-image-field-group" do - click_on "Remove Image" - accept_js_alert + alert_text = <<~TEXT.strip + The promo image will be removed immediately after you confirm. + TEXT + accept_alert(alert_text) do + click_on "Remove Image" + end end expect(page).to have_content("Promo image removed successfully") From 9ab335302e2d4da4897fc796905e1055eab77566 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 12 Oct 2021 15:43:42 +0100 Subject: [PATCH 4/7] Moves/updates index_spec into system --- spec/{features => system}/admin/enterprises/index_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/enterprises/index_spec.rb (99%) diff --git a/spec/features/admin/enterprises/index_spec.rb b/spec/system/admin/enterprises/index_spec.rb similarity index 99% rename from spec/features/admin/enterprises/index_spec.rb rename to spec/system/admin/enterprises/index_spec.rb index 676976351b9..019ca733a2e 100644 --- a/spec/features/admin/enterprises/index_spec.rb +++ b/spec/system/admin/enterprises/index_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe 'Enterprises Index' do include WebHelper From 6639ce416a72440908a4d49d29c5e216436572dc Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 12 Oct 2021 15:44:47 +0100 Subject: [PATCH 5/7] Squashes terms_and_conditions_spec edits Moves terms_and_conditions_spec into system Updates terms_and_conditions_spec into system --- .../admin/enterprises/terms_and_conditions_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/enterprises/terms_and_conditions_spec.rb (99%) diff --git a/spec/features/admin/enterprises/terms_and_conditions_spec.rb b/spec/system/admin/enterprises/terms_and_conditions_spec.rb similarity index 99% rename from spec/features/admin/enterprises/terms_and_conditions_spec.rb rename to spec/system/admin/enterprises/terms_and_conditions_spec.rb index a2ff0a03204..716519f9ca0 100644 --- a/spec/features/admin/enterprises/terms_and_conditions_spec.rb +++ b/spec/system/admin/enterprises/terms_and_conditions_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe "Uploading Terms and Conditions PDF" do include AuthenticationHelper From 33f374d177a1b6b7423d8650b7b540041f860ae2 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 19 Oct 2021 15:38:07 +0100 Subject: [PATCH 6/7] Defines strings for warning accepting with let --- spec/system/admin/enterprises/images_spec.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spec/system/admin/enterprises/images_spec.rb b/spec/system/admin/enterprises/images_spec.rb index 007723124b0..072af5b0083 100644 --- a/spec/system/admin/enterprises/images_spec.rb +++ b/spec/system/admin/enterprises/images_spec.rb @@ -18,6 +18,10 @@ end describe "images for an enterprise" do + + let(:alert_text_logo) {'The logo will be removed immediately after you confirm'.strip} + let(:alert_text_promo) {'The promo image will be removed immediately after you confirm.'.strip} + def go_to_images within(".side_menu") do click_link "Images" @@ -53,10 +57,7 @@ def go_to_images # Removing image within ".page-admin-enterprises-form__logo-field-group" do - alert_text = <<~TEXT.strip - The logo will be removed immediately after you confirm. - TEXT - accept_alert(alert_text) do + accept_alert(alert_text_logo) do click_on "Remove Image" end end @@ -95,10 +96,7 @@ def go_to_images # Removing image within ".page-admin-enterprises-form__promo-image-field-group" do - alert_text = <<~TEXT.strip - The promo image will be removed immediately after you confirm. - TEXT - accept_alert(alert_text) do + accept_alert(alert_text_promo) do click_on "Remove Image" end end From c7eed5ae576dd0040364dfa217a544886fc132e4 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Tue, 19 Oct 2021 15:44:26 +0100 Subject: [PATCH 7/7] Adds the system helper to business_address --- spec/system/admin/enterprises/business_address_form_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/admin/enterprises/business_address_form_spec.rb b/spec/system/admin/enterprises/business_address_form_spec.rb index 38c9681db7f..38f01a1ab0f 100644 --- a/spec/system/admin/enterprises/business_address_form_spec.rb +++ b/spec/system/admin/enterprises/business_address_form_spec.rb @@ -1,4 +1,4 @@ -require "spec_helper" +require "system_helper" describe "Business Address" do include WebHelper