feat(export.for_tier): add to export
This commit is contained in:
parent
5f5756a034
commit
c9235c8a3d
2 changed files with 11 additions and 1 deletions
|
@ -1199,7 +1199,10 @@ class Dossier < ApplicationRecord
|
||||||
columns += [
|
columns += [
|
||||||
['Civilité', individual&.gender],
|
['Civilité', individual&.gender],
|
||||||
['Nom', individual&.nom],
|
['Nom', individual&.nom],
|
||||||
['Prénom', individual&.prenom]
|
['Prénom', individual&.prenom],
|
||||||
|
['Dépot pour un tier', :for_tiers],
|
||||||
|
['Nom du mandataire', :mandataire_last_name],
|
||||||
|
['Prénom du mandataire', :mandataire_first_name]
|
||||||
]
|
]
|
||||||
if procedure.ask_birthday
|
if procedure.ask_birthday
|
||||||
columns += [['Date de naissance', individual&.birthdate]]
|
columns += [['Date de naissance', individual&.birthdate]]
|
||||||
|
|
|
@ -2126,6 +2126,13 @@ describe Dossier, type: :model do
|
||||||
describe "#spreadsheet_columns" do
|
describe "#spreadsheet_columns" do
|
||||||
let(:dossier) { create(:dossier) }
|
let(:dossier) { create(:dossier) }
|
||||||
|
|
||||||
|
context 'for_individual' do
|
||||||
|
let(:dossier) { create(:dossier, procedure: create(:procedure, :for_individual)) }
|
||||||
|
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(["Dépot pour un tier", :for_tiers]) }
|
||||||
|
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(['Nom du mandataire', :mandataire_last_name]) }
|
||||||
|
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(['Prénom du mandataire', :mandataire_first_name]) }
|
||||||
|
end
|
||||||
|
|
||||||
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(["État du dossier", "Brouillon"]) }
|
it { expect(dossier.spreadsheet_columns(types_de_champ: [])).to include(["État du dossier", "Brouillon"]) }
|
||||||
|
|
||||||
context 'procedure sva' do
|
context 'procedure sva' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue