From c5f6c9ae1e7dc704e0f2b65df228ded02108dd79 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 10 May 2021 11:00:57 +0200 Subject: [PATCH] fix missing state translation --- app/models/dossier.rb | 2 +- spec/models/dossier_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 9d7b53986..08dd41243 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -817,7 +817,7 @@ class Dossier < ApplicationRecord columns += [ ['Archivé', :archived], - ['État du dossier', I18n.t(state, scope: [:activerecord, :attributes, :dossier, :state])], + ['État du dossier', Dossier.human_attribute_name("state.#{state}")], ['Dernière mise à jour le', :updated_at], ['Déposé le', :en_construction_at], ['Passé en instruction le', :en_instruction_at], diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index ac82dd094..a81a63bef 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -1430,4 +1430,10 @@ describe Dossier do expect(dossier.destroy).to be_truthy end end + + describe "#spreadsheet_columns" do + let(:dossier) { create(:dossier) } + + it { expect(dossier.spreadsheet_columns(types_de_champ: [], types_de_champ_private: [])).to include(["État du dossier", "Brouillon"]) } + end end