diff --git a/config/locales/verification.en.yml b/config/locales/verification.en.yml index 729381932..1feb43860 100644 --- a/config/locales/verification.en.yml +++ b/config/locales/verification.en.yml @@ -76,7 +76,7 @@ en: office: "Verify in any %{office}" offices: "Office of Citizen" offices_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" - send_letter: "request a letter" + send_letter: "Request a letter" go_to_index: "See proposals and debates" create: flash: @@ -85,7 +85,7 @@ en: offices_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" edit: title: "Letter requested" - see_all: "Ver debates y propuestas" + see_all: "See proposals and debates" update: flash: success: "Correct code. Your account is verified" diff --git a/config/locales/verification.es.yml b/config/locales/verification.es.yml index e3883a454..bf0102ad1 100644 --- a/config/locales/verification.es.yml +++ b/config/locales/verification.es.yml @@ -11,7 +11,6 @@ es: user_permission_proposal: "Crear nuevas propuestas" user_permission_support_proposal: "Apoyar propuestas" user_permission_votes: "Participar en las votaciones finales" - user_permission_verify_info: "" residence: new: title: "Verificar residencia" diff --git a/spec/features/verification/letter_spec.rb b/spec/features/verification/letter_spec.rb index 8c9282800..d4b7eeb30 100644 --- a/spec/features/verification/letter_spec.rb +++ b/spec/features/verification/letter_spec.rb @@ -10,15 +10,9 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - click_button "Send me a letter with the code" + click_link "Request a letter" - expect(page).to have_content "Thank you for requesting a maximum security code in a few days we will send it to the address on your census data." - - user.reload - fill_in "letter_verification_code", with: user.letter_verification_code - click_button "Send" - - expect(page).to have_content "Correct code. Your account is verified" + expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." end scenario 'Go to office instead of send letter' do @@ -29,7 +23,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_link "See Office of Citizen", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" + expect(page).to have_link "Office of Citizen", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" end scenario 'Errors on verification code' do @@ -40,13 +34,9 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - click_button "Send me a letter with the code" - expect(page).to have_content "Thank you for requesting a maximum security code in a few days we will send it to the address on your census data." + click_link "Request a letter" + expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." - fill_in "letter_verification_code", with: "1" - click_button "Send" - - expect(page).to have_content "Incorrect confirmation code" end scenario "Deny access unless verified residence" do @@ -68,25 +58,4 @@ feature 'Verify Letter' do expect(page).to have_content 'You have not yet enter the confirmation code' expect(current_path).to eq(new_sms_path) end - - scenario '6 tries allowed' do - user = create(:user, residence_verified_at: Time.now, confirmed_phone: "611111111") - login_as(user) - - visit new_letter_path - click_button 'Send me a letter with the code' - - 6.times do - fill_in 'letter_verification_code', with: "999999" - click_button 'Send' - end - - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." - expect(current_path).to eq(account_path) - - visit new_letter_path - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." - expect(current_path).to eq(account_path) - end - end diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/features/verification/level_three_verification_spec.rb index 86368ff6b..b03741f42 100644 --- a/spec/features/verification/level_three_verification_spec.rb +++ b/spec/features/verification/level_three_verification_spec.rb @@ -20,7 +20,7 @@ feature 'Level three verification' do click_button "Send code" end - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code @@ -75,7 +75,7 @@ feature 'Level three verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code @@ -83,14 +83,8 @@ feature 'Level three verification' do expect(page).to have_content 'Correct code' - click_button "Send me a letter with the code" + click_link "Request a letter" - expect(page).to have_content "Thank you for requesting a maximum security code in a few days we will send it to the address on your census data." - - user.reload - fill_in "letter_verification_code", with: user.letter_verification_code - click_button "Send" - - expect(page).to have_content "We have not sent you the letter with the code yet" + expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." end end \ No newline at end of file diff --git a/spec/features/verification/level_two_verification_spec.rb b/spec/features/verification/level_two_verification_spec.rb index dfb1e29c2..ac0bf1a2f 100644 --- a/spec/features/verification/level_two_verification_spec.rb +++ b/spec/features/verification/level_two_verification_spec.rb @@ -14,7 +14,7 @@ feature 'Level two verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code diff --git a/spec/features/verification/sms_spec.rb b/spec/features/verification/sms_spec.rb index 3afe33a43..1d8026b81 100644 --- a/spec/features/verification/sms_spec.rb +++ b/spec/features/verification/sms_spec.rb @@ -11,7 +11,7 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code @@ -40,7 +40,7 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' click_button 'Send' @@ -66,7 +66,7 @@ feature 'SMS Verification' do 5.times do fill_in 'sms_phone', with: "611111111" click_button 'Send' - click_link 'Click here to send the confirmation code again' + click_link 'Request a new code' end expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index d1a6bcdf6..b07c93a89 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -127,7 +127,7 @@ module CommonActions fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Security code confirmation' + expect(page).to have_content 'Phone confirmation' user = User.last.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code