From 386d6516789e91d801df67246f0f5d09e8d84553 Mon Sep 17 00:00:00 2001 From: Diogo Matsubara Date: Fri, 23 Jun 2017 08:31:23 -0300 Subject: [PATCH] Fix #1611 (Rephrase error message for people logging in with an existing user email) update test to use new rspec syntax --- config/locales/en.yml | 6 ++++++ spec/features/consumer/authentication_spec.rb | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 760785c858..916041642d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,6 +60,12 @@ en: spree/order: payment_state: Payment State shipment_state: Shipment State + errors: + models: + spree/user: + attributes: + email: + taken: "There's already an account for this email. Please login or reset your password." devise: failure: invalid: | diff --git a/spec/features/consumer/authentication_spec.rb b/spec/features/consumer/authentication_spec.rb index 63f08efb71..12f067beed 100644 --- a/spec/features/consumer/authentication_spec.rb +++ b/spec/features/consumer/authentication_spec.rb @@ -60,6 +60,13 @@ feature "Authentication", js: true, retry: 3 do page.should have_content "too short" end + scenario "Failing to sign up because email is already registered" do + fill_in "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 + scenario "Signing up successfully" do fill_in "Email", with: "test@foo.com" fill_in "Choose a password", with: "test12345"