diff --git a/app/decorators/dossier_decorator.rb b/app/decorators/dossier_decorator.rb index 109b95bf7..8bf76769b 100644 --- a/app/decorators/dossier_decorator.rb +++ b/app/decorators/dossier_decorator.rb @@ -2,12 +2,6 @@ class DossierDecorator < Draper::Decorator delegate :current_page, :per_page, :offset, :total_entries, :total_pages delegate_all - def display_date - date_previsionnelle.localtime.strftime('%d/%m/%Y') - rescue - 'dd/mm/YYYY' - end - def first_creation created_at.localtime.strftime('%d/%m/%Y %H:%M') end @@ -20,16 +14,6 @@ class DossierDecorator < Draper::Decorator DossierDecorator.case_state_fr state end - def class_qp_active - 'qp' if procedure.module_api_carto.quartiers_prioritaires - end - - def state_color_class - return 'text-danger' if waiting_for_gestionnaire? - return 'text-info' if waiting_for_user? - return 'text-success' if termine? - end - def self.case_state_fr state=self.state h.t("activerecord.attributes.dossier.state.#{state}") end diff --git a/spec/decorators/dossier_decorator_spec.rb b/spec/decorators/dossier_decorator_spec.rb index 1dfef816a..d2a25c608 100644 --- a/spec/decorators/dossier_decorator_spec.rb +++ b/spec/decorators/dossier_decorator_spec.rb @@ -1,9 +1,14 @@ require 'spec_helper' describe DossierDecorator do - let(:dossier) { create(:dossier, updated_at: Time.new(2015, 12, 24, 14, 10)) } + let(:dossier) { create(:dossier, created_at: Time.new(2015, 12, 24, 14, 10), updated_at: Time.new(2015, 12, 24, 14, 10)) } subject { dossier.decorate } + describe 'created_at' do + subject { super().created_at } + it { is_expected.to eq('24/12/2015 14:10') } + end + describe 'last_update' do subject { super().last_update } it { is_expected.to eq('24/12/2015 14:10') }