[Fix #197] Show the motivation on a dossier’s details
This commit is contained in:
parent
12740b4a3e
commit
88267a990d
3 changed files with 19 additions and 2 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
= render partial: 'dossiers/messagerie', locals: { dossier_facade: @facade }
|
= render partial: 'dossiers/messagerie', locals: { dossier_facade: @facade }
|
||||||
|
|
||||||
|
= render partial: 'dossiers/motivation', locals: { dossier_facade: @facade }
|
||||||
|
|
||||||
- if @facade.procedure.individual_with_siret
|
- if @facade.procedure.individual_with_siret
|
||||||
.default-data-block
|
.default-data-block
|
||||||
.row.show-block.infos
|
.row.show-block.infos
|
||||||
|
|
11
app/views/dossiers/_motivation.html.haml
Normal file
11
app/views/dossiers/_motivation.html.haml
Normal 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
|
|
@ -1,8 +1,8 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'backoffice/dossiers/show.html.haml', type: :view do
|
describe 'backoffice/dossiers/show.html.haml', type: :view do
|
||||||
let!(:dossier) { create(:dossier, :with_entreprise, state: state) }
|
let!(:dossier) { create(:dossier, :with_entreprise, state: state, motivation: "Motivation de décision") }
|
||||||
let(:state) { 'draft' }
|
let(:state) { 'closed' }
|
||||||
let(:dossier_id) { dossier.id }
|
let(:dossier_id) { dossier.id }
|
||||||
let(:gestionnaire) { create(:gestionnaire) }
|
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')
|
expect(rendered).to_not have_css('#maj_infos')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "shows the motivation" do
|
||||||
|
expect(rendered).to have_content("Motivation de décision")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue