2015-09-24 16:51:14 +02:00
|
|
|
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) }
|
2015-12-24 15:10:20 +01:00
|
|
|
let(:state) { 'draft' }
|
2015-09-24 16:51:14 +02:00
|
|
|
let(:dossier_id) { dossier.id }
|
2015-12-24 15:10:20 +01:00
|
|
|
let(:gestionnaire) { create(:gestionnaire) }
|
2015-09-24 16:51:14 +02:00
|
|
|
|
|
|
|
before do
|
2015-12-24 15:10:20 +01:00
|
|
|
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'
|
2015-09-24 16:51:14 +02:00
|
|
|
end
|
|
|
|
|
2016-02-08 18:16:18 +01:00
|
|
|
context 'on the dossier gestionnaire page' do
|
2015-09-24 16:51:14 +02:00
|
|
|
before do
|
|
|
|
render
|
|
|
|
end
|
2016-03-22 17:36:36 +01:00
|
|
|
|
|
|
|
it 'button Modifier les document est present' do
|
|
|
|
expect(rendered).not_to have_content('Modifier les documents')
|
2017-04-12 11:12:05 +02:00
|
|
|
expect(rendered).not_to have_css('#upload-pj-modal')
|
2016-03-22 17:36:36 +01:00
|
|
|
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
|
2017-04-12 11:12:05 +02:00
|
|
|
expect(rendered).to have_selector('#infos-dossiers')
|
2015-09-24 16:51:14 +02:00
|
|
|
end
|
|
|
|
|
2015-11-02 16:36:52 +01:00
|
|
|
context 'edit link are present' do
|
|
|
|
it 'edit carto' do
|
2015-09-24 16:51:14 +02:00
|
|
|
expect(rendered).to_not have_selector('a[id=modif_carte]')
|
|
|
|
end
|
|
|
|
|
2015-11-02 16:36:52 +01:00
|
|
|
it 'edit description' do
|
2015-09-24 16:51:14 +02:00
|
|
|
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
|
2015-09-24 16:51:14 +02:00
|
|
|
expect(rendered).to_not have_css('#maj_infos')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|