2018-06-19 16:23:43 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2019-03-25 10:53:45 +01:00
|
|
|
describe 'users/dossiers/identite.html.haml', type: :view do
|
2020-01-07 17:50:49 +01:00
|
|
|
let(:procedure) { create(:simple_procedure, :for_individual) }
|
|
|
|
let(:dossier) { create(:dossier, :with_service, state: Dossier.states.fetch(:brouillon), procedure: procedure) }
|
2018-06-19 16:23:43 +02:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in dossier.user
|
|
|
|
assign(:dossier, dossier)
|
|
|
|
end
|
|
|
|
|
2019-01-07 12:17:11 +01:00
|
|
|
subject! { render }
|
2018-06-19 16:23:43 +02:00
|
|
|
|
2019-01-07 12:17:11 +01:00
|
|
|
it 'has identity fields' do
|
|
|
|
expect(rendered).to have_field('Prénom')
|
|
|
|
expect(rendered).to have_field('Nom')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the demarche asks for the birthdate' do
|
|
|
|
let(:procedure) { create(:simple_procedure, for_individual: true, ask_birthday: true) }
|
2018-06-19 16:23:43 +02:00
|
|
|
|
2019-01-07 12:17:11 +01:00
|
|
|
it 'has a birthday field' do
|
|
|
|
expect(rendered).to have_field('Date de naissance')
|
2018-06-19 16:23:43 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|