implementation du systeme de PJ de motivation
This commit is contained in:
parent
5477bd67ee
commit
4aab72be68
14 changed files with 144 additions and 45 deletions
|
@ -93,16 +93,17 @@ module Gestionnaires
|
||||||
|
|
||||||
def terminer
|
def terminer
|
||||||
motivation = params[:dossier] && params[:dossier][:motivation]
|
motivation = params[:dossier] && params[:dossier][:motivation]
|
||||||
|
justificatif = params[:dossier] && params[:dossier][:justificatif_motivation]
|
||||||
|
|
||||||
case params[:process_action]
|
case params[:process_action]
|
||||||
when "refuser"
|
when "refuser"
|
||||||
dossier.refuser!(current_gestionnaire, motivation)
|
dossier.refuser!(current_gestionnaire, motivation, justificatif)
|
||||||
flash.notice = "Dossier considéré comme refusé."
|
flash.notice = "Dossier considéré comme refusé."
|
||||||
when "classer_sans_suite"
|
when "classer_sans_suite"
|
||||||
dossier.classer_sans_suite!(current_gestionnaire, motivation)
|
dossier.classer_sans_suite!(current_gestionnaire, motivation, justificatif)
|
||||||
flash.notice = "Dossier considéré comme sans suite."
|
flash.notice = "Dossier considéré comme sans suite."
|
||||||
when "accepter"
|
when "accepter"
|
||||||
dossier.accepter!(current_gestionnaire, motivation)
|
dossier.accepter!(current_gestionnaire, motivation, justificatif)
|
||||||
flash.notice = "Dossier traité avec succès."
|
flash.notice = "Dossier traité avec succès."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,8 @@ export function motivationCancel() {
|
||||||
document.querySelectorAll('.motivation').forEach(hide);
|
document.querySelectorAll('.motivation').forEach(hide);
|
||||||
show(document.querySelector('.dropdown-items'));
|
show(document.querySelector('.dropdown-items'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function showImportJustificatif(name) {
|
||||||
|
show(document.querySelector('#justificatif_motivation_import_' + name));
|
||||||
|
hide(document.querySelector('#justificatif_motivation_suggest_' + name));
|
||||||
|
}
|
||||||
|
|
|
@ -29,7 +29,11 @@ import '../new_design/champs/repetition';
|
||||||
|
|
||||||
import { toggleCondidentielExplanation } from '../new_design/avis';
|
import { toggleCondidentielExplanation } from '../new_design/avis';
|
||||||
import { scrollMessagerie } from '../new_design/messagerie';
|
import { scrollMessagerie } from '../new_design/messagerie';
|
||||||
import { showMotivation, motivationCancel } from '../new_design/state-button';
|
import {
|
||||||
|
showMotivation,
|
||||||
|
motivationCancel,
|
||||||
|
showImportJustificatif
|
||||||
|
} from '../new_design/state-button';
|
||||||
import { toggleChart } from '../new_design/toggle-chart';
|
import { toggleChart } from '../new_design/toggle-chart';
|
||||||
import { replaceSemicolonByComma } from '../new_design/avis';
|
import { replaceSemicolonByComma } from '../new_design/avis';
|
||||||
|
|
||||||
|
@ -40,6 +44,7 @@ const DS = {
|
||||||
scrollMessagerie,
|
scrollMessagerie,
|
||||||
showMotivation,
|
showMotivation,
|
||||||
motivationCancel,
|
motivationCancel,
|
||||||
|
showImportJustificatif,
|
||||||
toggleChart,
|
toggleChart,
|
||||||
replaceSemicolonByComma
|
replaceSemicolonByComma
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,20 +17,20 @@ class NotificationMailer < ApplicationMailer
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_closed_notification(dossier)
|
def send_closed_notification(dossier)
|
||||||
send_notification(dossier, dossier.procedure.closed_mail_template)
|
send_final_notification(dossier, dossier.procedure.closed_mail_template, dossier.justificatif_motivation)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_refused_notification(dossier)
|
def send_refused_notification(dossier)
|
||||||
send_notification(dossier, dossier.procedure.refused_mail_template)
|
send_final_notification(dossier, dossier.procedure.refused_mail_template, dossier.justificatif_motivation)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_without_continuation_notification(dossier)
|
def send_without_continuation_notification(dossier)
|
||||||
send_notification(dossier, dossier.procedure.without_continuation_mail_template)
|
send_final_notification(dossier, dossier.procedure.without_continuation_mail_template, dossier.justificatif_motivation)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def send_notification(dossier, mail_template)
|
def send_notification(dossier, mail_template, attachment_file = nil)
|
||||||
email = dossier.user.email
|
email = dossier.user.email
|
||||||
|
|
||||||
subject = mail_template.subject_for_dossier(dossier)
|
subject = mail_template.subject_for_dossier(dossier)
|
||||||
|
|
|
@ -20,6 +20,8 @@ class Dossier < ApplicationRecord
|
||||||
has_one :attestation, dependent: :destroy
|
has_one :attestation, dependent: :destroy
|
||||||
|
|
||||||
has_many :pieces_justificatives, dependent: :destroy
|
has_many :pieces_justificatives, dependent: :destroy
|
||||||
|
has_one_attached :justificatif_motivation
|
||||||
|
|
||||||
has_many :champs, -> { root.public_only.ordered }, dependent: :destroy
|
has_many :champs, -> { root.public_only.ordered }, dependent: :destroy
|
||||||
has_many :champs_private, -> { root.private_only.ordered }, class_name: 'Champ', dependent: :destroy
|
has_many :champs_private, -> { root.private_only.ordered }, class_name: 'Champ', dependent: :destroy
|
||||||
has_many :commentaires, dependent: :destroy
|
has_many :commentaires, dependent: :destroy
|
||||||
|
@ -296,10 +298,12 @@ class Dossier < ApplicationRecord
|
||||||
log_dossier_operation(gestionnaire, :repasser_en_construction)
|
log_dossier_operation(gestionnaire, :repasser_en_construction)
|
||||||
end
|
end
|
||||||
|
|
||||||
def accepter!(gestionnaire, motivation)
|
def accepter!(gestionnaire, motivation, justificatif = nil)
|
||||||
self.motivation = motivation
|
self.motivation = motivation
|
||||||
self.en_instruction_at ||= Time.zone.now
|
self.en_instruction_at ||= Time.zone.now
|
||||||
|
if justificatif
|
||||||
|
self.justificatif_motivation.attach(justificatif)
|
||||||
|
end
|
||||||
accepte!
|
accepte!
|
||||||
|
|
||||||
if attestation.nil?
|
if attestation.nil?
|
||||||
|
@ -330,20 +334,24 @@ class Dossier < ApplicationRecord
|
||||||
DeletedDossier.create_from_dossier(self)
|
DeletedDossier.create_from_dossier(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def refuser!(gestionnaire, motivation)
|
def refuser!(gestionnaire, motivation, justificatif = nil)
|
||||||
self.motivation = motivation
|
self.motivation = motivation
|
||||||
self.en_instruction_at ||= Time.zone.now
|
self.en_instruction_at ||= Time.zone.now
|
||||||
|
if justificatif
|
||||||
|
self.justificatif_motivation.attach(justificatif)
|
||||||
|
end
|
||||||
refuse!
|
refuse!
|
||||||
|
|
||||||
NotificationMailer.send_refused_notification(self).deliver_later
|
NotificationMailer.send_refused_notification(self).deliver_later
|
||||||
log_dossier_operation(gestionnaire, :refuser)
|
log_dossier_operation(gestionnaire, :refuser)
|
||||||
end
|
end
|
||||||
|
|
||||||
def classer_sans_suite!(gestionnaire, motivation)
|
def classer_sans_suite!(gestionnaire, motivation, justificatif = nil)
|
||||||
self.motivation = motivation
|
self.motivation = motivation
|
||||||
self.en_instruction_at ||= Time.zone.now
|
self.en_instruction_at ||= Time.zone.now
|
||||||
|
if justificatif
|
||||||
|
self.justificatif_motivation.attach(justificatif)
|
||||||
|
end
|
||||||
sans_suite!
|
sans_suite!
|
||||||
|
|
||||||
NotificationMailer.send_without_continuation_notification(self).deliver_later
|
NotificationMailer.send_without_continuation_notification(self).deliver_later
|
||||||
|
|
|
@ -22,6 +22,7 @@ class DossierSerializer < ActiveModel::Serializer
|
||||||
has_many :champs_private
|
has_many :champs_private
|
||||||
has_many :pieces_justificatives
|
has_many :pieces_justificatives
|
||||||
has_many :types_de_piece_justificative
|
has_many :types_de_piece_justificative
|
||||||
|
has_one :justificatif_motivation
|
||||||
|
|
||||||
has_many :champs, serializer: ChampSerializer
|
has_many :champs, serializer: ChampSerializer
|
||||||
|
|
||||||
|
@ -52,6 +53,12 @@ class DossierSerializer < ActiveModel::Serializer
|
||||||
PiecesJustificativesService.serialize_champs_as_pjs(object)
|
PiecesJustificativesService.serialize_champs_as_pjs(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def justificatif_motivation
|
||||||
|
if object.justificatif_motivation.attached?
|
||||||
|
Rails.application.routes.url_helpers.url_for(object.justificatif_motivation)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def types_de_piece_justificative
|
def types_de_piece_justificative
|
||||||
ActiveModelSerializers::SerializableResource.new(object.types_de_piece_justificative).serializable_hash +
|
ActiveModelSerializers::SerializableResource.new(object.types_de_piece_justificative).serializable_hash +
|
||||||
PiecesJustificativesService.serialize_types_de_champ_as_type_pj(object)
|
PiecesJustificativesService.serialize_types_de_champ_as_type_pj(object)
|
||||||
|
|
|
@ -28,6 +28,10 @@
|
||||||
%li= unspecified_annotations_privee.libelle
|
%li= unspecified_annotations_privee.libelle
|
||||||
- else
|
- else
|
||||||
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: placeholder, required: true
|
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: placeholder, required: true
|
||||||
|
%span{ id: "justificatif_motivation_suggest_#{popup_class}", onclick: "DS.showImportJustificatif('#{popup_class}');" }
|
||||||
|
.button Ajouter un justificatif (optionnel)
|
||||||
|
.hidden{ id: "justificatif_motivation_import_#{popup_class}" }
|
||||||
|
= file_field :dossier, :justificatif_motivation, direct_upload: true
|
||||||
.text-right
|
.text-right
|
||||||
- if title == 'Accepter' && dossier.procedure.attestation_template&.activated?
|
- if title == 'Accepter' && dossier.procedure.attestation_template&.activated?
|
||||||
= link_to "Voir l'attestation", apercu_attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener', class: 'button', title: "Voir l'attestation qui sera envoyée au demandeur"
|
= link_to "Voir l'attestation", apercu_attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener', class: 'button', title: "Voir l'attestation qui sera envoyée au demandeur"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
- if dossier.present?
|
||||||
|
- justificatif = dossier.justificatif_motivation
|
||||||
|
- if dossier.justificatif_motivation.attached?
|
||||||
|
.action
|
||||||
|
= link_to (justificatif), target: '_blank', class: 'button primary' do
|
||||||
|
%span.icon.download
|
||||||
|
Télécharger le justificatif
|
|
@ -1,7 +1,7 @@
|
||||||
.container
|
.container
|
||||||
- if dossier.en_construction_at.present?
|
- if dossier.en_construction_at.present?
|
||||||
.card
|
.card
|
||||||
= render partial: "shared/dossiers/horodatage", locals: { dossier: dossier }
|
= render partial: "shared/dossiers/infos_generales", locals: { dossier: dossier }
|
||||||
|
|
||||||
.tab-title Identité du demandeur
|
.tab-title Identité du demandeur
|
||||||
.card
|
.card
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
%table.table.vertical.dossier-champs
|
|
||||||
%tbody
|
|
||||||
%tr
|
|
||||||
%th.libelle Déposé le :
|
|
||||||
%td= l(dossier.en_construction_at, format: '%d %B %Y')
|
|
14
app/views/shared/dossiers/_infos_generales.html.haml
Normal file
14
app/views/shared/dossiers/_infos_generales.html.haml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
%table.table.vertical.dossier-champs
|
||||||
|
%tbody
|
||||||
|
%tr
|
||||||
|
%th.libelle Déposé le :
|
||||||
|
%td= l(dossier.en_construction_at, format: '%d %B %Y')
|
||||||
|
- if dossier.justificatif_motivation.attached?
|
||||||
|
- justificatif = dossier.justificatif_motivation
|
||||||
|
%tr
|
||||||
|
%th.libelle Justificatif :
|
||||||
|
%td
|
||||||
|
.action
|
||||||
|
= link_to url_for(justificatif), target: '_blank', class: 'button primary' do
|
||||||
|
%span.icon.download
|
||||||
|
Télécharger le justificatif
|
|
@ -50,12 +50,15 @@
|
||||||
%h3 Motif de l’acceptation
|
%h3 Motif de l’acceptation
|
||||||
%blockquote= dossier.motivation
|
%blockquote= dossier.motivation
|
||||||
|
|
||||||
|
= render partial: 'new_user/dossiers/show/download_justificatif', locals: { dossier: dossier }
|
||||||
|
|
||||||
- if dossier.attestation.present?
|
- if dossier.attestation.present?
|
||||||
.action
|
.action
|
||||||
= link_to attestation_dossier_path(dossier), target: '_blank', rel: 'noopener', class: 'button primary' do
|
= link_to attestation_dossier_path(dossier), target: '_blank', rel: 'noopener', class: 'button primary' do
|
||||||
%span.icon.download
|
%span.icon.download
|
||||||
Télécharger l’attestation
|
Télécharger l’attestation
|
||||||
|
|
||||||
|
|
||||||
- elsif dossier.refuse?
|
- elsif dossier.refuse?
|
||||||
.refuse
|
.refuse
|
||||||
%p.decision
|
%p.decision
|
||||||
|
@ -68,6 +71,7 @@
|
||||||
%h3 Motif du refus
|
%h3 Motif du refus
|
||||||
%blockquote= dossier.motivation
|
%blockquote= dossier.motivation
|
||||||
|
|
||||||
|
= render partial: 'new_user/dossiers/show/download_justificatif', locals: { dossier: @dossier }
|
||||||
.action
|
.action
|
||||||
= link_to 'Envoyer un message à l’administration', messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button'
|
= link_to 'Envoyer un message à l’administration', messagerie_dossier_url(dossier, anchor: 'new_commentaire'), class: 'button'
|
||||||
|
|
||||||
|
@ -79,6 +83,8 @@
|
||||||
= succeed '.' do
|
= succeed '.' do
|
||||||
%strong sans suite
|
%strong sans suite
|
||||||
|
|
||||||
|
= render partial: 'new_user/dossiers/show/download_justificatif', locals: { dossier: @dossier }
|
||||||
|
|
||||||
- if dossier.motivation.present?
|
- if dossier.motivation.present?
|
||||||
%h3 Motif du classement sans suite
|
%h3 Motif du classement sans suite
|
||||||
%blockquote= dossier.motivation
|
%blockquote= dossier.motivation
|
||||||
|
|
|
@ -139,7 +139,7 @@ describe API::V1::DossiersController do
|
||||||
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, :en_construction, procedure: procedure, motivation: "Motivation") } }
|
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, :en_construction, procedure: procedure, motivation: "Motivation") } }
|
||||||
let(:dossier_id) { dossier.id }
|
let(:dossier_id) { dossier.id }
|
||||||
let(:body) { JSON.parse(retour.body, symbolize_names: true) }
|
let(:body) { JSON.parse(retour.body, symbolize_names: true) }
|
||||||
let(:field_list) { [:id, :created_at, :updated_at, :archived, :individual, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :motivation, :email, :instructeurs] }
|
let(:field_list) { [:id, :created_at, :updated_at, :archived, :individual, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at, :motivation, :email, :instructeurs, :justificatif_motivation] }
|
||||||
subject { body[:dossier] }
|
subject { body[:dossier] }
|
||||||
|
|
||||||
it 'return REST code 200', :show_in_doc do
|
it 'return REST code 200', :show_in_doc do
|
||||||
|
|
|
@ -7,6 +7,7 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
let(:gestionnaires) { [gestionnaire] }
|
let(:gestionnaires) { [gestionnaire] }
|
||||||
let(:procedure) { create(:procedure, :published, gestionnaires: gestionnaires) }
|
let(:procedure) { create(:procedure, :published, gestionnaires: gestionnaires) }
|
||||||
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
let(:dossier) { create(:dossier, :en_construction, procedure: procedure) }
|
||||||
|
let(:fake_justificatif) { Rack::Test::UploadedFile.new("./spec/fixtures/files/piece_justificative_0.pdf", 'application/pdf') }
|
||||||
|
|
||||||
before { sign_in(gestionnaire) }
|
before { sign_in(gestionnaire) }
|
||||||
|
|
||||||
|
@ -141,6 +142,7 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
sign_in gestionnaire
|
sign_in gestionnaire
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'simple refusal' do
|
||||||
subject { post :terminer, params: { process_action: "refuser", procedure_id: procedure.id, dossier_id: dossier.id }, format: 'js' }
|
subject { post :terminer, params: { process_action: "refuser", procedure_id: procedure.id, dossier_id: dossier.id }, format: 'js' }
|
||||||
|
|
||||||
it 'change state to refuse' do
|
it 'change state to refuse' do
|
||||||
|
@ -148,6 +150,7 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
|
|
||||||
dossier.reload
|
dossier.reload
|
||||||
expect(dossier.state).to eq(Dossier.states.fetch(:refuse))
|
expect(dossier.state).to eq(Dossier.states.fetch(:refuse))
|
||||||
|
expect(dossier.justificatif_motivation).to_not be_attached
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Notification email is sent' do
|
it 'Notification email is sent' do
|
||||||
|
@ -157,16 +160,29 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
|
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'refusal with a justificatif' do
|
||||||
|
subject { post :terminer, params: { process_action: "refuser", procedure_id: procedure.id, dossier_id: dossier.id, dossier: { justificatif_motivation: fake_justificatif } }, format: 'js' }
|
||||||
|
|
||||||
|
it 'attachs a justificatif' do
|
||||||
|
subject
|
||||||
|
|
||||||
|
dossier.reload
|
||||||
|
expect(dossier.state).to eq(Dossier.states.fetch(:refuse))
|
||||||
|
expect(dossier.justificatif_motivation).to be_attached
|
||||||
|
end
|
||||||
|
|
||||||
it { expect(subject.body).to include('.state-button') }
|
it { expect(subject.body).to include('.state-button') }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "with classer_sans_suite" do
|
context "with classer_sans_suite" do
|
||||||
before do
|
before do
|
||||||
dossier.en_instruction!
|
dossier.en_instruction!
|
||||||
sign_in gestionnaire
|
sign_in gestionnaire
|
||||||
end
|
end
|
||||||
|
context 'without attachment' do
|
||||||
subject { post :terminer, params: { process_action: "classer_sans_suite", procedure_id: procedure.id, dossier_id: dossier.id }, format: 'js' }
|
subject { post :terminer, params: { process_action: "classer_sans_suite", procedure_id: procedure.id, dossier_id: dossier.id }, format: 'js' }
|
||||||
|
|
||||||
it 'change state to sans_suite' do
|
it 'change state to sans_suite' do
|
||||||
|
@ -174,6 +190,7 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
|
|
||||||
dossier.reload
|
dossier.reload
|
||||||
expect(dossier.state).to eq(Dossier.states.fetch(:sans_suite))
|
expect(dossier.state).to eq(Dossier.states.fetch(:sans_suite))
|
||||||
|
expect(dossier.justificatif_motivation).to_not be_attached
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Notification email is sent' do
|
it 'Notification email is sent' do
|
||||||
|
@ -187,6 +204,21 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
it { expect(subject.body).to include('.state-button') }
|
it { expect(subject.body).to include('.state-button') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with attachment' do
|
||||||
|
subject { post :terminer, params: { process_action: "classer_sans_suite", procedure_id: procedure.id, dossier_id: dossier.id, dossier: { justificatif_motivation: fake_justificatif } }, format: 'js' }
|
||||||
|
|
||||||
|
it 'change state to sans_suite' do
|
||||||
|
subject
|
||||||
|
|
||||||
|
dossier.reload
|
||||||
|
expect(dossier.state).to eq(Dossier.states.fetch(:sans_suite))
|
||||||
|
expect(dossier.justificatif_motivation).to be_attached
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(subject.body).to include('.state-button') }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "with accepter" do
|
context "with accepter" do
|
||||||
before do
|
before do
|
||||||
dossier.en_instruction!
|
dossier.en_instruction!
|
||||||
|
@ -206,6 +238,7 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
|
|
||||||
dossier.reload
|
dossier.reload
|
||||||
expect(dossier.state).to eq(Dossier.states.fetch(:accepte))
|
expect(dossier.state).to eq(Dossier.states.fetch(:accepte))
|
||||||
|
expect(dossier.justificatif_motivation).to_not be_attached
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the dossier does not have any attestation' do
|
context 'when the dossier does not have any attestation' do
|
||||||
|
@ -261,6 +294,20 @@ describe Gestionnaires::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { subject }
|
it { subject }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with an attachment' do
|
||||||
|
subject { post :terminer, params: { process_action: "accepter", procedure_id: procedure.id, dossier_id: dossier.id, dossier: { justificatif_motivation: fake_justificatif } }, format: 'js' }
|
||||||
|
|
||||||
|
it 'change state to accepte' do
|
||||||
|
subject
|
||||||
|
|
||||||
|
dossier.reload
|
||||||
|
expect(dossier.state).to eq(Dossier.states.fetch(:accepte))
|
||||||
|
expect(dossier.justificatif_motivation).to be_attached
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(subject.body).to include('.state-button') }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue