Fixes failing specs after adding geozones to residence verifications

This commit is contained in:
kikito
2016-02-19 17:24:48 +01:00
parent 06bd44c225
commit 3ad5fa19e5
5 changed files with 11 additions and 4 deletions

View File

@@ -308,5 +308,6 @@ FactoryGirl.define do
factory :geozone do factory :geozone do
sequence(:name) { |n| "District #{n}" } sequence(:name) { |n| "District #{n}" }
census_code { '01' }
end end
end end

View File

@@ -59,6 +59,7 @@ feature 'Stats' do
end end
scenario 'Level 2 user' do scenario 'Level 2 user' do
create(:geozone)
visit account_path visit account_path
click_link 'Verify my account' click_link 'Verify my account'
verify_residence verify_residence

View File

@@ -2,6 +2,7 @@ require 'rails_helper'
feature 'Level three verification' do feature 'Level three verification' do
scenario 'Verification with residency and verified sms' do scenario 'Verification with residency and verified sms' do
create(:geozone)
user = create(:user) user = create(:user)
verified_user = create(:verified_user, verified_user = create(:verified_user,
@@ -33,6 +34,7 @@ feature 'Level three verification' do
end end
scenario 'Verification with residency and verified email' do scenario 'Verification with residency and verified email' do
create(:geozone)
user = create(:user) user = create(:user)
verified_user = create(:verified_user, verified_user = create(:verified_user,
@@ -63,7 +65,7 @@ feature 'Level three verification' do
end end
scenario 'Verification with residency and sms and letter' do scenario 'Verification with residency and sms and letter' do
create(:geozone)
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -87,4 +89,4 @@ feature 'Level three verification' do
expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file." expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file."
end end
end end

View File

@@ -3,6 +3,7 @@ require 'rails_helper'
feature 'Level two verification' do feature 'Level two verification' do
scenario 'Verification with residency and sms' do scenario 'Verification with residency and sms' do
create(:geozone)
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -23,4 +24,4 @@ feature 'Level two verification' do
expect(page).to have_content 'Code correct' expect(page).to have_content 'Code correct'
end end
end end

View File

@@ -2,6 +2,8 @@ require 'rails_helper'
feature 'Residence' do feature 'Residence' do
background { create(:geozone) }
scenario 'Verify resident in Madrid' do scenario 'Verify resident in Madrid' do
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -100,4 +102,4 @@ feature 'Residence' do
expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(page).to have_content "You have reached the maximum number of attempts. Please try again later."
expect(current_path).to eq(account_path) expect(current_path).to eq(account_path)
end end
end end