Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-09-05 14:57:29 +02:00
commit 926ecb23cc
36 changed files with 162 additions and 53 deletions

View file

@ -128,6 +128,11 @@ $big-number-card-padding: 2 * $segmented-control-item-border-radius;
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px; margin-bottom: 20px;
color: $light-grey; color: $light-grey;
&.long-title {
margin-left: -30px;
margin-right: -30px;
}
} }
.big-number-card-number { .big-number-card-number {

View file

@ -1,7 +1,7 @@
@import "colors"; @import "colors";
@import "constants"; @import "constants";
.status-progress { .status-overview {
text-align: center; text-align: center;
} }

View file

@ -4,8 +4,8 @@ module NewUser
helper_method :new_demarche_url helper_method :new_demarche_url
before_action :ensure_ownership!, except: [:index, :show, :formulaire, :modifier, :update, :recherche] before_action :ensure_ownership!, except: [:index, :show, :demande, :messagerie, :modifier, :update, :recherche]
before_action :ensure_ownership_or_invitation!, only: [:show, :formulaire, :modifier, :update] before_action :ensure_ownership_or_invitation!, only: [:show, :demande, :messagerie, :modifier, :update, :create_commentaire]
before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update] before_action :ensure_dossier_can_be_updated, only: [:update_identite, :update]
before_action :forbid_invite_submission!, only: [:update] before_action :forbid_invite_submission!, only: [:update]
@ -34,10 +34,15 @@ module NewUser
@dossier = dossier @dossier = dossier
end end
def formulaire def demande
@dossier = dossier @dossier = dossier
end end
def messagerie
@dossier = dossier
@commentaire = Commentaire.new
end
def attestation def attestation
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf') send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
end end
@ -109,7 +114,7 @@ module NewUser
redirect_to merci_dossier_path(@dossier) redirect_to merci_dossier_path(@dossier)
elsif current_user.owns?(dossier) elsif current_user.owns?(dossier)
if Flipflop.new_dossier_details? if Flipflop.new_dossier_details?
redirect_to formulaire_dossier_path(@dossier) redirect_to demande_dossier_path(@dossier)
else else
redirect_to users_dossier_recapitulatif_path(@dossier) redirect_to users_dossier_recapitulatif_path(@dossier)
end end
@ -122,6 +127,18 @@ module NewUser
@dossier = current_user.dossiers.includes(:procedure).find(params[:id]) @dossier = current_user.dossiers.includes(:procedure).find(params[:id])
end end
def create_commentaire
@commentaire = CommentaireService.create(current_user, dossier, commentaire_params)
if @commentaire.save
flash.notice = "Message envoyé"
redirect_to messagerie_dossier_path(dossier)
else
flash.now.alert = @commentaire.errors.full_messages
render :messagerie
end
end
def ask_deletion def ask_deletion
dossier = current_user.dossiers.includes(:user, procedure: :administrateur).find(params[:id]) dossier = current_user.dossiers.includes(:user, procedure: :administrateur).find(params[:id])
@ -185,7 +202,7 @@ module NewUser
end end
def dossier def dossier
Dossier.find(params[:id] || params[:dossier_id]) @dossier ||= Dossier.find(params[:id] || params[:dossier_id])
end end
def dossier_with_champs def dossier_with_champs
@ -223,6 +240,10 @@ module NewUser
params.require(:dossier).permit(:autorisation_donnees) params.require(:dossier).permit(:autorisation_donnees)
end end
def commentaire_params
params.require(:commentaire).permit(:body, :file)
end
def passage_en_construction? def passage_en_construction?
dossier.brouillon? && !draft? dossier.brouillon? && !draft?
end end

View file

@ -2,4 +2,4 @@
= render partial: 'header', locals: { avis: @avis, dossier: @dossier } = render partial: 'header', locals: { avis: @avis, dossier: @dossier }
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_gestionnaire_avis_path(@avis) } = render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, user_email: current_gestionnaire.email, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_gestionnaire_avis_path(@avis) }

View file

@ -2,4 +2,4 @@
= render partial: 'header', locals: { avis: @avis, dossier: @dossier } = render partial: 'header', locals: { avis: @avis, dossier: @dossier }
= render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil } = render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil }

View file

@ -2,4 +2,4 @@
= render partial: "header", locals: { dossier: @dossier } = render partial: "header", locals: { dossier: @dossier }
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_gestionnaire_dossier_path(@dossier.procedure, @dossier) } = render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, user_email: current_gestionnaire.email, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_gestionnaire_dossier_path(@dossier.procedure, @dossier) }

View file

@ -84,7 +84,7 @@
%ul.messages-list %ul.messages-list
- @dossier.commentaires.each do |commentaire| - @dossier.commentaires.each do |commentaire|
%li %li
= render partial: "new_gestionnaire/shared/messages/message", locals: { commentaire: commentaire, messagerie_seen_at: nil } = render partial: "new_gestionnaire/shared/messages/message", locals: { commentaire: commentaire, user_email: current_gestionnaire.email, messagerie_seen_at: nil }
%script{ type: "text/javascript" } %script{ type: "text/javascript" }
window.print(); window.print();

View file

@ -2,4 +2,4 @@
= render partial: "header", locals: { dossier: @dossier } = render partial: "header", locals: { dossier: @dossier }
= render partial: "shared/dossiers/show", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at } = render partial: "shared/dossiers/demande", locals: { dossier: @dossier, demande_seen_at: @demande_seen_at }

View file

@ -109,7 +109,7 @@
%td.status-col %td.status-col
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do = link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
= render partial: 'shared/dossiers/status', locals: { dossier: dossier } = render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) } %td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
= paginate @dossiers = paginate @dossiers
- else - else

View file

@ -29,6 +29,6 @@
%td= link_to(dossier.user.email, dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') %td= link_to(dossier.user.email, dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link')
%td.status-col %td.status-col
= link_to(dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') do = link_to(dossier_linked_path(current_gestionnaire, dossier), class: 'cell-link') do
= render partial: 'shared/dossiers/status', locals: { dossier: dossier } = render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
- else - else
%h2 Aucun dossier correspondant à votre recherche n'a été trouvé %h2 Aucun dossier correspondant à votre recherche n'a été trouvé

View file

@ -1,7 +0,0 @@
.messagerie.container
%ul.messages-list
- dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, current_gestionnaire.email) }
= render partial: "new_gestionnaire/shared/messages/message", locals: { commentaire: commentaire, messagerie_seen_at: messagerie_seen_at }
= render partial: "new_gestionnaire/shared/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }

View file

@ -1,7 +1,9 @@
- content_for(:title, "Demande · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")
#dossier-show #dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier } = render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }
= render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil } = render partial: 'shared/dossiers/demande', locals: { dossier: @dossier, demande_seen_at: nil }
.container .container
- if !@dossier.read_only? - if !@dossier.read_only?

View file

@ -1,3 +1,5 @@
- content_for(:title, "Nouveau dossier (#{@dossier.procedure.libelle})")
- content_for :footer do - content_for :footer do
= render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier }

View file

@ -1,3 +1,5 @@
- content_for(:title, "Dossiers")
.dossiers-headers.sub-header .dossiers-headers.sub-header
.container .container
= link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button secondary new-demarche" = link_to "Commencer une nouvelle démarche", new_demarche_url, class: "button secondary new-demarche"
@ -40,7 +42,7 @@
= dossier.procedure.libelle = dossier.procedure.libelle
%td.status-col %td.status-col
= link_to(url_for_dossier(dossier), class: 'cell-link') do = link_to(url_for_dossier(dossier), class: 'cell-link') do
= render partial: 'shared/dossiers/status', locals: { dossier: dossier } = render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
%td.updated-at-col %td.updated-at-col
= link_to(url_for_dossier(dossier), class: 'cell-link') do = link_to(url_for_dossier(dossier), class: 'cell-link') do
= dossier.updated_at.localtime.strftime("%d/%m/%Y") = dossier.updated_at.localtime.strftime("%d/%m/%Y")

View file

@ -1,3 +1,5 @@
- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})")
.merci .merci
.container .container
= image_tag('user/envoi-dossier.svg') = image_tag('user/envoi-dossier.svg')

View file

@ -0,0 +1,6 @@
- content_for(:title, "Messagerie · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")
#dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }
= render partial: "shared/dossiers/messagerie", locals: { dossier: @dossier, user_email: current_user.email, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_dossier_path(@dossier) }

View file

@ -1,3 +1,5 @@
- content_for(:title, "Modification du brouillon nº #{@dossier.id} (#{@dossier.procedure.libelle})")
- content_for :footer do - content_for :footer do
= render partial: "new_user/dossiers/footer", locals: { dossier: @dossier } = render partial: "new_user/dossiers/footer", locals: { dossier: @dossier }

View file

@ -1,5 +1,7 @@
- content_for(:title, "Résumé · Dossier nº #{@dossier.id} (#{@dossier.procedure.libelle})")
#dossier-show #dossier-show
= render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier } = render partial: 'new_user/dossiers/show/header', locals: { dossier: @dossier }
.container .container
= render partial: 'new_user/dossiers/show/status_progress', locals: { dossier: @dossier } = render partial: 'new_user/dossiers/show/status_overview', locals: { dossier: @dossier }

View file

@ -1,6 +1,6 @@
.sub-header .sub-header
.container .container
= render partial: 'shared/dossiers/status', locals: { dossier: dossier } = render partial: 'shared/dossiers/status_badge', locals: { dossier: dossier }
.title-container .title-container
%span.icon.folder %span.icon.folder
@ -9,4 +9,5 @@
%ul.tabs %ul.tabs
= active_tab_item('Résumé', dossier_path(dossier)) = active_tab_item('Résumé', dossier_path(dossier))
= active_tab_item('Formulaire', formulaire_dossier_path(dossier)) = active_tab_item('Demande', demande_dossier_path(dossier))
= active_tab_item('Messagerie', messagerie_dossier_path(dossier))

View file

@ -1,4 +1,4 @@
.status-progress .status-overview
- if !dossier.termine? - if !dossier.termine?
%ul.status-timeline %ul.status-timeline
%li.brouillon{ class: dossier.brouillon? ? 'active' : nil } %li.brouillon{ class: dossier.brouillon? ? 'active' : nil }

View file

@ -0,0 +1,7 @@
.messagerie.container
%ul.messages-list
- dossier.commentaires.each do |commentaire|
%li{ class: commentaire_is_from_me_class(commentaire, user_email) }
= render partial: "shared/dossiers/messages/message", locals: { commentaire: commentaire, user_email: user_email, messagerie_seen_at: messagerie_seen_at }
= render partial: "shared/dossiers/messages/form", locals: { commentaire: new_commentaire, form_url: form_url }

View file

@ -2,7 +2,7 @@
%span.label.brouillon brouillon %span.label.brouillon brouillon
- elsif dossier.en_construction? - elsif dossier.en_construction?
%span.label.construction en construction %span.label.construction en construction
- if dossier.en_instruction? - elsif dossier.en_instruction?
%span.label.instruction en instruction %span.label.instruction en instruction
- elsif dossier.accepte? - elsif dossier.accepte?
%span.label.accepted accepté %span.label.accepted accepté

View file

@ -1,10 +1,10 @@
= render partial: 'new_gestionnaire/shared/messages/message_icon', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire } = render partial: 'shared/dossiers/messages/message_icon', locals: { commentaire: commentaire, user_email: user_email }
.width-100 .width-100
%h2 %h2
%span.mail %span.mail
= render partial: 'new_gestionnaire/shared/messages/message_issuer', locals: { commentaire: commentaire, current_gestionnaire: current_gestionnaire } = render partial: 'shared/dossiers/messages/message_issuer', locals: { commentaire: commentaire, user_email: user_email }
- if ![current_gestionnaire.email, commentaire.dossier.user.email, OLD_CONTACT_EMAIL, CONTACT_EMAIL].include?(commentaire.email) - if ![user_email, commentaire.dossier.user.email, OLD_CONTACT_EMAIL, CONTACT_EMAIL].include?(commentaire.email)
%span.guest Invité %span.guest Invité
%span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) } %span.date{ class: highlight_if_unseen_class(messagerie_seen_at, commentaire.created_at) }
= I18n.l(commentaire.created_at.localtime, format: '%d/%m/%Y à %H:%M ') = I18n.l(commentaire.created_at.localtime, format: '%d/%m/%Y à %H:%M ')

View file

@ -1,5 +1,5 @@
- case commentaire.email - case commentaire.email
- when current_gestionnaire.email - when user_email
= image_tag('icons/account-circle.svg', class: 'person-icon') = image_tag('icons/account-circle.svg', class: 'person-icon')
- when OLD_CONTACT_EMAIL - when OLD_CONTACT_EMAIL
- when CONTACT_EMAIL - when CONTACT_EMAIL

View file

@ -1,5 +1,5 @@
- case commentaire.email - case commentaire.email
- when current_gestionnaire.email - when user_email
Vous Vous
- when OLD_CONTACT_EMAIL - when OLD_CONTACT_EMAIL
- when CONTACT_EMAIL - when CONTACT_EMAIL

View file

@ -6,7 +6,7 @@
.stat-cards .stat-cards
.stat-card.stat-card-half.big-number-card.pull-left .stat-card.stat-card-half.big-number-card.pull-left
%span.big-number-card-title TOTAL PROCÉDURES DÉMATÉRIALISÉES %span.big-number-card-title.long-title TOTAL DÉMARCHES DÉMAT. OU EN COURS DE DÉMAT.
%span.big-number-card-number %span.big-number-card-number
= number_with_delimiter(@procedures_numbers[:total]) = number_with_delimiter(@procedures_numbers[:total])
%span.big-number-card-detail %span.big-number-card-detail
@ -43,7 +43,7 @@
Par mois Par mois
%li.segmented-control-item{ :onclick => "DS.toggleChart(event, '.cumulative-procedures-chart');" } %li.segmented-control-item{ :onclick => "DS.toggleChart(event, '.cumulative-procedures-chart');" }
Cumul Cumul
%span.stat-card-title.pull-left Procédures dématérialisées %span.stat-card-title.pull-left Démarches dématérialisées
.clearfix .clearfix
.chart-container .chart-container
@ -69,7 +69,7 @@
.stat-card.stat-card-half.pull-left .stat-card.stat-card-half.pull-left
%span.stat-card-title %span.stat-card-title
Nombre d'administrations ayant dématérialisé N procédures Nombre d'administrations ayant dématérialisé N démarches
.chart-container .chart-container
.chart .chart
@ -121,8 +121,8 @@
= column_chart @motivation_usage_dossier, ytitle: 'dossiers avec motivation / total dossiers', xtitle: 'semaines' = column_chart @motivation_usage_dossier, ytitle: 'dossiers avec motivation / total dossiers', xtitle: 'semaines'
.stat-card.stat-card-half.pull-left .stat-card.stat-card-half.pull-left
%span.stat-card-title Taux d'utilisation des motivations (par procédure) %span.stat-card-title Taux d'utilisation des motivations (par démarche)
= column_chart @motivation_usage_procedure, ytitle: 'procedures avec motivation / total procedures', xtitle: 'semaines' = column_chart @motivation_usage_procedure, ytitle: 'démarches avec motivation / total démarches', xtitle: 'semaines'
.clearfix .clearfix
@ -131,7 +131,7 @@
.stat-cards .stat-cards
.stat-card.stat-card-half.pull-left .stat-card.stat-card-half.pull-left
%span.stat-card-title Taux d'utilisation de la bibliothèque %span.stat-card-title Taux d'utilisation de la bibliothèque
= column_chart @cloned_from_library_procedures_ratio, ytitle: 'procédures clonées / total procédure', xtitle: 'semaines' = column_chart @cloned_from_library_procedures_ratio, ytitle: 'démarches clonées / total démarches', xtitle: 'semaines'
.clearfix .clearfix

View file

@ -278,7 +278,9 @@ Rails.application.routes.draw do
get 'modifier' get 'modifier'
patch 'modifier', to: 'dossiers#update' patch 'modifier', to: 'dossiers#update'
get 'merci' get 'merci'
get 'formulaire' get 'demande'
get 'messagerie'
post 'commentaire' => 'dossiers#create_commentaire'
post 'ask_deletion' post 'ask_deletion'
get 'attestation' get 'attestation'
end end

View file

@ -517,10 +517,52 @@ describe NewUser::DossiersController, type: :controller do
sign_in(user) sign_in(user)
end end
subject! { get(:formulaire, params: { id: dossier.id }) } subject! { get(:demande, params: { id: dossier.id }) }
it { expect(assigns(:dossier)).to eq(dossier) } it { expect(assigns(:dossier)).to eq(dossier) }
it { is_expected.to render_template(:formulaire) } it { is_expected.to render_template(:demande) }
end
describe "#create_commentaire" do
let(:dossier) { create(:dossier, :en_construction, user: user) }
let(:saved_commentaire) { dossier.commentaires.first }
let(:body) { "avant\napres" }
let(:file) { Rack::Test::UploadedFile.new("./spec/support/files/piece_justificative_0.pdf", 'application/pdf') }
let(:scan_result) { true }
subject {
post :create_commentaire, params: {
id: dossier.id,
commentaire: {
body: body,
file: file
}
}
}
before do
sign_in(user)
allow(ClamavService).to receive(:safe_file?).and_return(scan_result)
end
it "creates a commentaire" do
expect { subject }.to change(Commentaire, :count).by(1)
expect(response).to redirect_to(messagerie_dossier_path(dossier))
expect(flash.notice).to be_present
end
context "when the commentaire creation fails" do
let(:scan_result) { false }
it "renders the messagerie page with the invalid commentaire" do
expect { subject }.not_to change(Commentaire, :count)
expect(response).to render_template :messagerie
expect(flash.alert).to be_present
expect(assigns(:commentaire).body).to eq("<p>avant\n<br />apres</p>")
end
end
end end
describe '#ask_deletion' do describe '#ask_deletion' do

View file

@ -20,19 +20,40 @@ describe 'Dossier details:' do
scenario 'the user can see and edit dossier before instruction' do scenario 'the user can see and edit dossier before instruction' do
visit_dossier dossier visit_dossier dossier
click_on 'Formulaire' click_on 'Demande'
expect(page).to have_current_path(formulaire_dossier_path(dossier)) expect(page).to have_current_path(demande_dossier_path(dossier))
click_on 'Modifier le dossier' click_on 'Modifier le dossier'
expect(page).to have_current_path(modifier_dossier_path(dossier)) expect(page).to have_current_path(modifier_dossier_path(dossier))
fill_in('texte obligatoire', with: 'Nouveau texte') fill_in('texte obligatoire', with: 'Nouveau texte')
click_on 'Enregistrer les modifications du dossier' click_on 'Enregistrer les modifications du dossier'
expect(page).to have_current_path(formulaire_dossier_path(dossier)) expect(page).to have_current_path(demande_dossier_path(dossier))
expect(page).to have_content('Nouveau texte') expect(page).to have_content('Nouveau texte')
end end
context 'with messages' do
let!(:commentaire) { create(:commentaire, dossier: dossier, email: 'instructeur@exemple.fr', body: 'Message envoyé à lusager') }
let(:message_body) { 'Message envoyé à linstructeur' }
scenario 'the user can send a message' do
visit_dossier dossier
click_on 'Messagerie'
expect(page).to have_current_path(messagerie_dossier_path(dossier))
expect(page).to have_content(commentaire.body)
fill_in 'commentaire_body', with: message_body
click_on 'Envoyer'
expect(page).to have_current_path(messagerie_dossier_path(dossier))
expect(page).to have_content('Message envoyé')
expect(page).to have_content(commentaire.body)
expect(page).to have_content(message_body)
end
end
private private
def visit_dossier(dossier) def visit_dossier(dossier)

View file

@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
describe 'new_user/dossiers/formulaire.html.haml', type: :view do describe 'new_user/dossiers/demande.html.haml', type: :view do
let(:procedure) { create(:procedure, :published, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_type_de_champ_private) } let(:procedure) { create(:procedure, :published, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_type_de_champ_private) }
let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) } let(:dossier) { create(:dossier, :en_construction, :with_entreprise, procedure: procedure) }
@ -16,7 +16,7 @@ describe 'new_user/dossiers/formulaire.html.haml', type: :view do
it 'renders the dossier infos' do it 'renders the dossier infos' do
expect(rendered).to have_text('Identité') expect(rendered).to have_text('Identité')
expect(rendered).to have_text('Formulaire') expect(rendered).to have_text('Demande')
expect(rendered).to have_text('Pièces jointes') expect(rendered).to have_text('Pièces jointes')
end end

View file

@ -12,6 +12,6 @@ describe 'new_user/dossiers/show.html.haml', type: :view do
it 'renders a summary of the dossier state' do it 'renders a summary of the dossier state' do
expect(rendered).to have_text("Dossier nº #{dossier.id}") expect(rendered).to have_text("Dossier nº #{dossier.id}")
expect(rendered).to have_selector('.status-progress') expect(rendered).to have_selector('.status-overview')
end end
end end

View file

@ -10,6 +10,6 @@ describe 'new_user/dossiers/show/header.html.haml', type: :view do
expect(rendered).to have_selector("ul.tabs") expect(rendered).to have_selector("ul.tabs")
expect(rendered).to have_link("Résumé", href: dossier_path(dossier)) expect(rendered).to have_link("Résumé", href: dossier_path(dossier))
expect(rendered).to have_link("Formulaire", href: formulaire_dossier_path(dossier)) expect(rendered).to have_link("Demande", href: demande_dossier_path(dossier))
end end
end end

View file

@ -1,5 +1,5 @@
describe 'new_user/dossiers/show/_status_progress.html.haml', type: :view do describe 'new_user/dossiers/show/_status_overview.html.haml', type: :view do
subject! { render 'new_user/dossiers/show/status_progress.html.haml', dossier: dossier } subject! { render 'new_user/dossiers/show/status_overview.html.haml', dossier: dossier }
matcher :have_timeline_item do |selector| matcher :have_timeline_item do |selector|
match do |rendered| match do |rendered|

View file

@ -1,11 +1,10 @@
describe 'new_gestionnaire/shared/messages/message.html.haml', type: :view do describe 'shared/dossiers/messages/message.html.haml', type: :view do
before { view.extend DossierHelper } before { view.extend DossierHelper }
subject { render 'new_gestionnaire/shared/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, current_gestionnaire: current_gestionnaire } subject { render 'shared/dossiers/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, user_email: dossier.user.email }
let(:dossier) { create(:dossier) } let(:dossier) { create(:dossier) }
let(:commentaire) { create(:commentaire, dossier: dossier) } let(:commentaire) { create(:commentaire, dossier: dossier) }
let(:current_gestionnaire) { create(:gestionnaire) }
let(:seen_at) { commentaire.created_at + 1.hour } let(:seen_at) { commentaire.created_at + 1.hour }
context "with a seen_at after commentaire created_at" do context "with a seen_at after commentaire created_at" do