Updates test for verification
This commit is contained in:
@@ -76,7 +76,7 @@ en:
|
|||||||
office: "Verify in any %{office}"
|
office: "Verify in any %{office}"
|
||||||
offices: "Office of Citizen"
|
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"
|
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"
|
go_to_index: "See proposals and debates"
|
||||||
create:
|
create:
|
||||||
flash:
|
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"
|
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:
|
edit:
|
||||||
title: "Letter requested"
|
title: "Letter requested"
|
||||||
see_all: "Ver debates y propuestas"
|
see_all: "See proposals and debates"
|
||||||
update:
|
update:
|
||||||
flash:
|
flash:
|
||||||
success: "Correct code. Your account is verified"
|
success: "Correct code. Your account is verified"
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ es:
|
|||||||
user_permission_proposal: "Crear nuevas propuestas"
|
user_permission_proposal: "Crear nuevas propuestas"
|
||||||
user_permission_support_proposal: "Apoyar propuestas"
|
user_permission_support_proposal: "Apoyar propuestas"
|
||||||
user_permission_votes: "Participar en las votaciones finales"
|
user_permission_votes: "Participar en las votaciones finales"
|
||||||
user_permission_verify_info: ""
|
|
||||||
residence:
|
residence:
|
||||||
new:
|
new:
|
||||||
title: "Verificar residencia"
|
title: "Verificar residencia"
|
||||||
|
|||||||
@@ -10,15 +10,9 @@ feature 'Verify Letter' do
|
|||||||
login_as(user)
|
login_as(user)
|
||||||
visit new_letter_path
|
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."
|
expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account."
|
||||||
|
|
||||||
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"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Go to office instead of send letter' do
|
scenario 'Go to office instead of send letter' do
|
||||||
@@ -29,7 +23,7 @@ feature 'Verify Letter' do
|
|||||||
login_as(user)
|
login_as(user)
|
||||||
visit new_letter_path
|
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
|
end
|
||||||
|
|
||||||
scenario 'Errors on verification code' do
|
scenario 'Errors on verification code' do
|
||||||
@@ -40,13 +34,9 @@ feature 'Verify Letter' do
|
|||||||
login_as(user)
|
login_as(user)
|
||||||
visit new_letter_path
|
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."
|
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
|
end
|
||||||
|
|
||||||
scenario "Deny access unless verified residence" do
|
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(page).to have_content 'You have not yet enter the confirmation code'
|
||||||
expect(current_path).to eq(new_sms_path)
|
expect(current_path).to eq(new_sms_path)
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ feature 'Level three verification' do
|
|||||||
click_button "Send code"
|
click_button "Send code"
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
user = user.reload
|
user = user.reload
|
||||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
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"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
user = user.reload
|
user = user.reload
|
||||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
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'
|
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."
|
expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account."
|
||||||
|
|
||||||
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"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -14,7 +14,7 @@ feature 'Level two verification' do
|
|||||||
fill_in 'sms_phone', with: "611111111"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
user = user.reload
|
user = user.reload
|
||||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ feature 'SMS Verification' do
|
|||||||
fill_in 'sms_phone', with: "611111111"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
user = user.reload
|
user = user.reload
|
||||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
||||||
@@ -40,7 +40,7 @@ feature 'SMS Verification' do
|
|||||||
fill_in 'sms_phone', with: "611111111"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ feature 'SMS Verification' do
|
|||||||
5.times do
|
5.times do
|
||||||
fill_in 'sms_phone', with: "611111111"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
click_link 'Click here to send the confirmation code again'
|
click_link 'Request a new code'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later."
|
expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later."
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ module CommonActions
|
|||||||
fill_in 'sms_phone', with: "611111111"
|
fill_in 'sms_phone', with: "611111111"
|
||||||
click_button 'Send'
|
click_button 'Send'
|
||||||
|
|
||||||
expect(page).to have_content 'Security code confirmation'
|
expect(page).to have_content 'Phone confirmation'
|
||||||
|
|
||||||
user = User.last.reload
|
user = User.last.reload
|
||||||
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
|
||||||
|
|||||||
Reference in New Issue
Block a user