From 6116fd88817975fb3152d2297182727bbb7363cd Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 21 Jan 2022 19:29:28 +0000 Subject: [PATCH] Improve inaccurate specs --- spec/support/request/authentication_helper.rb | 4 ++-- spec/system/consumer/authentication_spec.rb | 23 ++++++++----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/spec/support/request/authentication_helper.rb b/spec/support/request/authentication_helper.rb index 147e7ff631..813121f49a 100644 --- a/spec/support/request/authentication_helper.rb +++ b/spec/support/request/authentication_helper.rb @@ -24,8 +24,8 @@ module AuthenticationHelper end def fill_in_and_submit_login_form(user) - fill_in "email", with: user.email - fill_in "password", with: user.password + fill_in "Email", with: user.email + fill_in "Password", with: user.password click_button "Login" end diff --git a/spec/system/consumer/authentication_spec.rb b/spec/system/consumer/authentication_spec.rb index 6844dd19e7..dc2a8930ba 100644 --- a/spec/system/consumer/authentication_spec.rb +++ b/spec/system/consumer/authentication_spec.rb @@ -61,38 +61,35 @@ describe "Authentication", js: true do end it "Failing to sign up because password is too short" do - fill_in "Email", with: "test@foo.com" + fill_in "Your email", with: "test@foo.com" fill_in "Choose a password", with: "short" click_signup_button expect(page).to have_content "too short" end it "Failing to sign up because email is already registered" do - fill_in "Email", with: user.email + fill_in "Your email", with: user.email fill_in "Choose a password", with: "foobarino" click_signup_button expect(page).to have_content "There's already an account for this email." end it "Failing to sign up because password confirmation doesn't match or is blank" do - fill_in "Email", with: user.email + fill_in "Your email", with: user.email fill_in "Choose a password", with: "ForgotToRetype" click_signup_button expect(page).to have_content "doesn't match" end it "Signing up successfully" do - performing_deliveries do - setup_email - fill_in "Email", with: "test@foo.com" - fill_in "Choose a password", with: "test12345" - fill_in "Confirm password", with: "test12345" + fill_in "Your email", with: "test@foo.com" + fill_in "Choose a password", with: "test12345" + fill_in "Confirm password", with: "test12345" - expect do - click_signup_button - expect(page).to have_content I18n.t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') - end.to enqueue_job ActionMailer::MailDeliveryJob - end + expect do + click_signup_button + expect(page).to have_content I18n.t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') + end.to enqueue_job ActionMailer::MailDeliveryJob end end