2015-09-22 15:00:59 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'on backoffice page' do
|
2015-11-10 11:58:56 +01:00
|
|
|
let(:administrateur) { create(:administrateur) }
|
|
|
|
let(:gestionnaire) { create(:gestionnaire, administrateur: administrateur) }
|
|
|
|
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
|
|
|
|
2016-01-18 17:18:04 +01:00
|
|
|
let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') }
|
2015-09-22 15:00:59 +02:00
|
|
|
before do
|
|
|
|
visit backoffice_path
|
|
|
|
end
|
|
|
|
context 'when gestionnaire is logged in' do
|
|
|
|
before do
|
2015-11-10 11:58:56 +01:00
|
|
|
page.find_by_id(:gestionnaire_email).set gestionnaire.email
|
|
|
|
page.find_by_id(:gestionnaire_password).set gestionnaire.password
|
2015-09-22 15:00:59 +02:00
|
|
|
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
|