adds specs
This commit is contained in:
@@ -13,8 +13,13 @@ describe PagesController do
|
|||||||
expect(response).to be_ok
|
expect(response).to be_ok
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should include a general terms page' do
|
||||||
|
get :general_terms
|
||||||
|
expect(response).to be_ok
|
||||||
|
end
|
||||||
|
|
||||||
it 'should include a terms page' do
|
it 'should include a terms page' do
|
||||||
get :terms
|
get :census_terms
|
||||||
expect(response).to be_ok
|
expect(response).to be_ok
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ FactoryGirl.define do
|
|||||||
document_type 1
|
document_type 1
|
||||||
date_of_birth Date.new(1980, 12, 31)
|
date_of_birth Date.new(1980, 12, 31)
|
||||||
postal_code "28013"
|
postal_code "28013"
|
||||||
|
terms_of_service '1'
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :verification_sms, class: Verification::Sms do
|
factory :verification_sms, class: Verification::Sms do
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ feature 'Residence' do
|
|||||||
select 'Spanish ID', from: 'residence_document_type'
|
select 'Spanish ID', from: 'residence_document_type'
|
||||||
select_date '31-December-1980', from: 'residence_date_of_birth'
|
select_date '31-December-1980', from: 'residence_date_of_birth'
|
||||||
fill_in 'residence_postal_code', with: '28013'
|
fill_in 'residence_postal_code', with: '28013'
|
||||||
|
check 'residence_terms_of_service'
|
||||||
|
|
||||||
click_button 'Verify'
|
click_button 'Verify'
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ feature 'Residence' do
|
|||||||
select 'January', from: 'residence_date_of_birth_2i'
|
select 'January', from: 'residence_date_of_birth_2i'
|
||||||
select '1', from: 'residence_date_of_birth_3i'
|
select '1', from: 'residence_date_of_birth_3i'
|
||||||
fill_in 'residence_postal_code', with: '28013'
|
fill_in 'residence_postal_code', with: '28013'
|
||||||
|
check 'residence_terms_of_service'
|
||||||
|
|
||||||
click_button 'Verify'
|
click_button 'Verify'
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ feature 'Residence' do
|
|||||||
select 'January', from: 'residence_date_of_birth_2i'
|
select 'January', from: 'residence_date_of_birth_2i'
|
||||||
select '1', from: 'residence_date_of_birth_3i'
|
select '1', from: 'residence_date_of_birth_3i'
|
||||||
fill_in 'residence_postal_code', with: '28013'
|
fill_in 'residence_postal_code', with: '28013'
|
||||||
|
check 'residence_terms_of_service'
|
||||||
|
|
||||||
click_button 'Verify'
|
click_button 'Verify'
|
||||||
expect(page).to have_content 'The census of the city of Madrid could not verify your information'
|
expect(page).to have_content 'The census of the city of Madrid could not verify your information'
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ describe Verification::Residence do
|
|||||||
residence.valid?
|
residence.valid?
|
||||||
expect(residence.errors[:document_number]).to include("Already in use")
|
expect(residence.errors[:document_number]).to include("Already in use")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should validate census terms" do
|
||||||
|
residence.terms_of_service = nil
|
||||||
|
expect(residence).to_not be_valid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "save" do
|
describe "save" do
|
||||||
|
|||||||
Reference in New Issue
Block a user