demarches-normaliennes/spec/views/users/dossiers/identite.html.haml_spec.rb

27 lines
745 B
Ruby
Raw Normal View History

require 'spec_helper'
2019-03-25 10:53:45 +01:00
describe 'users/dossiers/identite.html.haml', 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
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) }
it 'has a birthday field' do
expect(rendered).to have_field('Date de naissance')
end
end
end