demarches-normaliennes/spec/features/backoffice/navigate_to_dossier_spec.rb
Xavier J fd9061abdf - Administrateur can't show only his procedures
- Gestionnaire can't show only files of his Administrateur's procedures
2015-11-10 11:58:56 +01:00

27 lines
No EOL
903 B
Ruby

require 'spec_helper'
feature 'on backoffice page' do
let(:administrateur) { create(:administrateur) }
let(:gestionnaire) { create(:gestionnaire, administrateur: administrateur) }
let(:procedure) { create(:procedure, administrateur: administrateur) }
let!(:dossier) { create(:dossier, :with_user, :with_entreprise, procedure: procedure, state: 'replied') }
before do
visit backoffice_path
end
context 'when gestionnaire is logged in' do
before do
page.find_by_id(:gestionnaire_email).set gestionnaire.email
page.find_by_id(:gestionnaire_password).set gestionnaire.password
page.click_on 'Se connecter'
end
context 'when he click on first dossier' do
before do
page.click_on dossier.nom_projet
end
scenario 'it redirect to dossier page' do
expect(page).to have_css('#backoffice_dossier_show')
end
end
end
end