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

40 lines
1.3 KiB
Ruby
Raw Normal View History

require 'spec_helper'
describe 'dossiers/show.html.haml', type: :view do
let(:user) { create(:user) }
let(:dossier) { create(:dossier, :with_entreprise, user: user) }
before do
assign(:dossier, dossier)
assign(:entreprise, dossier.entreprise.decorate)
assign(:etablissement, dossier.etablissement)
render
end
it 'have autorisation_donnees check box' do
expect(rendered).to have_css('#dossier_autorisation_donnees')
end
2015-09-23 19:20:03 +02:00
context "sur la page d'information d'un SIRET" do
it 'Le formulaire envoie vers /users/dossiers/:dossier_id en #POST' do
expect(rendered).to have_selector("form[action='/users/dossiers'][method=post]")
end
2015-09-23 19:20:03 +02:00
it "la checkbox d'information est présente" do
expect(rendered).to have_css('#dossier_autorisation_donnees')
end
2015-09-23 19:20:03 +02:00
it "le texte d'information des droits est correct" do
expect(rendered).to have_content("J'autorise les organismes publics à vérifier les informations de mon entreprise auprès des administrations concernées. Ces informations resteront strictement confidentielles.")
end
2015-09-23 19:20:03 +02:00
it "les informations de l'entreprise sont présents" do
expect(rendered).to have_content('Siret')
end
it 'le bouton "Etape suivante" est présent' do
expect(rendered).to have_selector('#etape_suivante')
end
end
2015-08-20 17:30:17 +02:00
end