Remove the useless #for_display proxy method
This commit is contained in:
parent
2e6c91e9b0
commit
9a2341c56c
3 changed files with 3 additions and 7 deletions
|
@ -29,10 +29,6 @@ class Champs::LinkedDropDownListChamp < Champ
|
|||
:primary_value
|
||||
end
|
||||
|
||||
def for_display
|
||||
string_value
|
||||
end
|
||||
|
||||
def mandatory_and_blank?
|
||||
mandatory? && (primary_value.blank? || secondary_value.blank?)
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
- when TypeDeChamp.type_champs.fetch(:linked_drop_down_list)
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
||||
%td= c.for_display
|
||||
%td= c
|
||||
- when TypeDeChamp.type_champs.fetch(:dossier_link)
|
||||
%th.libelle
|
||||
= "#{c.libelle} :"
|
||||
|
|
|
@ -16,12 +16,12 @@ describe Champs::LinkedDropDownListChamp do
|
|||
it { expect(champ.value).to eq('["tata","tutu"]') }
|
||||
end
|
||||
|
||||
describe '#for_display' do
|
||||
describe '#to_s' do
|
||||
let(:champ) { described_class.new(primary_value: primary_value, secondary_value: secondary_value) }
|
||||
let(:primary_value) { nil }
|
||||
let(:secondary_value) { nil }
|
||||
|
||||
subject { champ.for_display }
|
||||
subject { champ.to_s }
|
||||
|
||||
context 'with no value' do
|
||||
it { is_expected.to eq('') }
|
||||
|
|
Loading…
Reference in a new issue