Delete un-user code in DossierDecorator

This commit is contained in:
Xavier J 2016-12-16 09:43:59 +01:00
parent 3c11bef503
commit fb16d4582d
2 changed files with 6 additions and 17 deletions

View file

@ -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

View file

@ -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') }