2015-08-25 16:33:55 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
describe 'users/recapitulatif/show.html.haml', type: :view do
|
2015-09-24 12:04:44 +02:00
|
|
|
let(:dossier) { create(:dossier, :with_entreprise, :with_procedure, :with_user) }
|
2015-09-24 11:37:18 +02:00
|
|
|
let(:dossier_id) { dossier.id }
|
|
|
|
|
2015-08-25 16:33:55 +02:00
|
|
|
before do
|
|
|
|
assign(:dossier, dossier.decorate)
|
2015-09-24 11:37:18 +02:00
|
|
|
assign(:procedure, dossier.procedure)
|
2015-08-25 16:33:55 +02:00
|
|
|
assign(:commentaires, dossier.commentaires)
|
|
|
|
render
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
context 'sur la rendered recapitulative' do
|
|
|
|
it 'la section infos dossier est présente' do
|
|
|
|
expect(rendered).to have_selector('#infos_dossier')
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
it 'le flux de commentaire est présent' do
|
|
|
|
expect(rendered).to have_selector('#commentaires_flux')
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
it 'le numéro de dossier est présent' do
|
|
|
|
expect(rendered).to have_selector('#dossier_id')
|
|
|
|
expect(rendered).to have_content(dossier_id)
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
context 'les liens de modifications' do
|
|
|
|
context 'lien description' do
|
|
|
|
it 'le lien vers description est présent' do
|
|
|
|
expect(rendered).to have_css('#maj_infos')
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
it 'le lien vers description est correct' do
|
|
|
|
expect(rendered).to have_selector("a[id=maj_infos][href='/users/dossiers/#{dossier_id}/description?back_url=recapitulatif']")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-09-24 12:04:44 +02:00
|
|
|
|
2015-09-24 11:37:18 +02:00
|
|
|
# context 'visibilité Félicitation' do
|
|
|
|
# it 'Est affiché quand l\'on vient de la rendered description hors modification' do
|
|
|
|
# expect(rendered).to have_content('Félicitation')
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# it 'N\'est pas affiché quand l\'on vient d\'une autre la rendered que description' do
|
|
|
|
# Capybara.current_session.driver.header('Referer', '/')
|
|
|
|
#
|
|
|
|
# expect(rendered).to_not have_content('Félicitation')
|
|
|
|
# end
|
|
|
|
#
|
|
|
|
# it 'N\'est pas affiché quand l\'on vient de la rendered description en modification' do
|
|
|
|
# Capybara.current_session.driver.header('Referer', '/description?back_url=recapitulatif')
|
|
|
|
#
|
|
|
|
# expect(rendered).to_not have_content('Félicitation')
|
|
|
|
# end
|
|
|
|
# end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-25 16:33:55 +02:00
|
|
|
end
|