demarches-normaliennes/spec/views/backoffice/dossiers/show.html.html_spec.rb

49 lines
1.3 KiB
Ruby
Raw Normal View History

require 'spec_helper'
describe 'backoffice/dossiers/show.html.haml', type: :view do
2016-02-04 14:08:35 +01:00
let!(:dossier) { create(:dossier, :with_entreprise, state: state) }
let(:state) { 'draft' }
let(:dossier_id) { dossier.id }
let(:gestionnaire) { create(:gestionnaire) }
before do
sign_in gestionnaire
assign(:facade, (DossierFacades.new dossier.id, gestionnaire.email))
2016-10-27 13:43:10 +02:00
@request.env['PATH_INFO'] = 'backoffice/user'
end
context 'on the dossier gestionnaire page' do
before do
render
end
it 'button Modifier les document est present' do
expect(rendered).not_to have_content('Modifier les documents')
expect(rendered).not_to have_css('#upload-pj-modal')
end
2016-12-14 18:41:33 +01:00
it 'enterprise informations are present' do
expect(rendered).to have_selector('#infos_entreprise')
end
it 'dossier informations are present' do
expect(rendered).to have_selector('#infos-dossiers')
end
2015-11-02 16:36:52 +01:00
context 'edit link are present' do
it 'edit carto' do
expect(rendered).to_not have_selector('a[id=modif_carte]')
end
2015-11-02 16:36:52 +01:00
it 'edit description' do
expect(rendered).to_not have_selector('a[id=modif_description]')
end
2015-11-02 16:36:52 +01:00
it 'Editer mon dossier button doesnt present' do
expect(rendered).to_not have_css('#maj_infos')
end
end
end
end