demarches-normaliennes/spec/views/shared/dossiers/_identite_entreprise.html.haml_spec.rb
Christophe Robillard 8e7f210216 affiche infos entreprise uniquement si diffusable
le champ de type siret affiche les infos d'une entreprise dont les infos sont diffusables uniquement aux instructeurs
2020-03-17 15:57:02 +00:00

24 lines
888 B
Ruby
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

describe 'shared/dossiers/identite_entreprise.html.haml', type: :view do
before { render 'shared/dossiers/identite_entreprise.html.haml', etablissement: etablissement, profile: 'usager' }
context "there is an association" do
let(:etablissement) { create(:etablissement, :is_association) }
context "date_publication is missing on rna" do
before { etablissement.update(association_date_publication: nil) }
it "can render without error" do
expect(rendered).to include("Date de publication :")
end
end
end
context "for an entreprise with private infos" do
let(:etablissement) { create(:etablissement, :non_diffusable) }
it "displays only public infos" do
expect(rendered).to have_text(etablissement.entreprise_raison_sociale)
expect(rendered).not_to have_text(etablissement.entreprise.forme_juridique)
end
end
end