demarches-normaliennes/spec/views/users/dossiers/identite.html.haml_spec.rb
2023-12-12 22:35:11 +00:00

26 lines
766 B
Ruby

describe 'users/dossiers/identite', type: :view do
let(:procedure) { create(:simple_procedure, :for_individual) }
let(:dossier) { create(:dossier, :with_service, state: Dossier.states.fetch(:brouillon), procedure: procedure) }
before do
sign_in dossier.user
assign(:dossier, dossier)
end
subject! { render }
it 'has identity fields' do
within('.individual-infos') do
expect(rendered).to have_field(id: 'Prenom')
expect(rendered).to have_field(id: 'Nom')
end
end
context 'when the demarche asks for the birthdate' do
let(:procedure) { create(:simple_procedure, for_individual: true, ask_birthday: true) }
it 'has a birthday field' do
expect(rendered).to have_field('Date de naissance')
end
end
end