refactors lock tries [#279]

This commit is contained in:
rgarcia
2015-09-10 17:51:18 +02:00
parent c1c213f773
commit abc68dc868
19 changed files with 171 additions and 63 deletions

View File

@@ -57,23 +57,23 @@ feature 'SMS Verification' do
expect(URI.parse(current_url).path).to eq(new_residence_path)
end
scenario '3 tries allowed' do
scenario '5 tries allowed' do
user = create(:user, residence_verified_at: Time.now)
login_as(user)
visit new_sms_path
3.times do
5.times do
fill_in 'sms_phone', with: "611111111"
click_button 'Send'
click_link 'Click here to send the confirmation code again'
end
expect(page).to have_content 'You have reached the maximum number of sms verification tries'
expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later."
expect(URI.parse(current_url).path).to eq(account_path)
visit new_sms_path
expect(page).to have_content 'You have reached the maximum number of sms verification tries'
expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later."
expect(URI.parse(current_url).path).to eq(account_path)
end