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

20 lines
716 B
Ruby
Raw Normal View History

2019-03-25 10:53:45 +01:00
describe 'users/dossiers/show/header.html.haml', type: :view do
2018-08-14 15:02:39 +02:00
let(:dossier) { create(:dossier, :en_construction, procedure: create(:procedure)) }
before do
sign_in dossier.user
end
2019-03-25 10:53:45 +01:00
subject! { render 'users/dossiers/show/header.html.haml', dossier: dossier }
2018-08-14 15:02:39 +02:00
it 'affiche les informations du dossier' do
expect(rendered).to have_text(dossier.procedure.libelle)
2018-10-08 18:44:19 +02:00
expect(rendered).to have_text("Dossier nº #{dossier.id}")
2018-08-14 15:02:39 +02:00
expect(rendered).to have_text("en construction")
expect(rendered).to have_selector("ul.tabs")
expect(rendered).to have_link("Résumé", href: dossier_path(dossier))
expect(rendered).to have_link("Demande", href: demande_dossier_path(dossier))
2018-08-14 15:02:39 +02:00
end
end