Updates test for verification

This commit is contained in:
Alberto Garcia Cabeza
2015-10-02 17:13:34 +02:00
parent ebcb1009ae
commit 818887924a
7 changed files with 16 additions and 54 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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."

View File

@@ -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