2018-08-14 13:39:49 +02:00
|
|
|
|
describe 'shared/dossiers/identite_entreprise.html.haml', type: :view do
|
2018-10-17 12:12:32 +02:00
|
|
|
|
before { render 'shared/dossiers/identite_entreprise.html.haml', etablissement: etablissement, profile: 'usager' }
|
2017-10-17 14:58:34 +02:00
|
|
|
|
|
|
|
|
|
context "there is an association" do
|
2018-04-05 18:54:33 +02:00
|
|
|
|
let(:etablissement) { create(:etablissement, :is_association) }
|
2017-10-17 14:58:34 +02:00
|
|
|
|
|
|
|
|
|
context "date_publication is missing on rna" do
|
2018-04-05 18:54:33 +02:00
|
|
|
|
before { etablissement.update(association_date_publication: nil) }
|
2017-10-17 14:58:34 +02:00
|
|
|
|
|
|
|
|
|
it "can render without error" do
|
|
|
|
|
expect(rendered).to include("Date de publication :")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-03-11 16:45:33 +01:00
|
|
|
|
|
|
|
|
|
context "for an entreprise with private infos" do
|
2023-03-15 10:39:14 +01:00
|
|
|
|
let(:etablissement) { create(:etablissement, :non_diffusable, siret: "12345678900001") }
|
2020-03-11 16:45:33 +01:00
|
|
|
|
|
2023-03-15 10:39:14 +01:00
|
|
|
|
it "hide any info except siret" do
|
|
|
|
|
expect(rendered).to have_text("123 456 789 00001")
|
|
|
|
|
expect(rendered).not_to have_text(etablissement.entreprise_raison_sociale)
|
2020-03-11 16:45:33 +01:00
|
|
|
|
expect(rendered).not_to have_text(etablissement.entreprise.forme_juridique)
|
|
|
|
|
end
|
|
|
|
|
end
|
2017-10-17 14:58:34 +02:00
|
|
|
|
end
|