[Fix #197] Show the motivation on a dossier’s details

This commit is contained in:
gregoirenovel 2017-06-01 11:26:21 +02:00
parent 12740b4a3e
commit 88267a990d
3 changed files with 19 additions and 2 deletions

View file

@ -2,6 +2,8 @@
= render partial: 'dossiers/messagerie', locals: { dossier_facade: @facade }
= render partial: 'dossiers/motivation', locals: { dossier_facade: @facade }
- if @facade.procedure.individual_with_siret
.default-data-block
.row.show-block.infos

View file

@ -0,0 +1,11 @@
- if Dossier::TERMINE.include?(@facade.dossier.state) && @facade.dossier.motivation.present?
.default-data-block.default_visible
.row.show-block.infos
.header
.col-xs-12.title
.carret-right
.carret-down
MOTIVATION
.body
.display-block-on-print
= @facade.dossier.motivation

View file

@ -1,8 +1,8 @@
require 'spec_helper'
describe 'backoffice/dossiers/show.html.haml', type: :view do
let!(:dossier) { create(:dossier, :with_entreprise, state: state) }
let(:state) { 'draft' }
let!(:dossier) { create(:dossier, :with_entreprise, state: state, motivation: "Motivation de décision") }
let(:state) { 'closed' }
let(:dossier_id) { dossier.id }
let(:gestionnaire) { create(:gestionnaire) }
@ -44,5 +44,9 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do
expect(rendered).to_not have_css('#maj_infos')
end
end
it "shows the motivation" do
expect(rendered).to have_content("Motivation de décision")
end
end
end