demarches-normaliennes/spec/views/new_user/dossiers/etablissement.html.haml_spec.rb
2018-10-17 10:37:06 +02:00

35 lines
1.1 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require 'spec_helper'
describe 'new_user/dossiers/etablissement.html.haml', type: :view do
let(:etablissement) { create(:etablissement, :with_exercices) }
let(:dossier) { create(:dossier, etablissement: etablissement) }
let(:footer) { view.content_for(:footer) }
before do
sign_in dossier.user
assign(:dossier, dossier)
end
subject! { render }
it 'affiche les informations de létablissement' do
expect(rendered).to have_text(etablissement.entreprise_raison_sociale)
expect(rendered).to have_text(etablissement.siret)
end
it 'naffiche pas publiquement les derniers exercices comptables' do
expect(rendered).not_to have_text(number_to_currency(etablissement.exercices.first.ca))
end
context 'quand létablissement est une association' do
let(:etablissement) { create(:etablissement, :is_association) }
it 'affiche les informations de lassociation' do
expect(rendered).to have_text(etablissement.association_titre)
end
end
it 'prépare le footer' do
expect(footer).to have_selector('footer')
end
end