diff --git a/spec/models/champs/decimal_number_champ_spec.rb b/spec/models/champs/decimal_number_champ_spec.rb index 39ead6506..fc5be9d75 100644 --- a/spec/models/champs/decimal_number_champ_spec.rb +++ b/spec/models/champs/decimal_number_champ_spec.rb @@ -51,4 +51,21 @@ describe Champs::DecimalNumberChamp do it { is_expected.to be_truthy } end end + + describe 'for_export' do + let(:champ) { create(:champ_decimal_number, value:) } + subject { champ.for_export } + context 'with nil' do + let(:value) { 0 } + it { is_expected.to be_nil } + end + context 'with simple number' do + let(:value) { "120" } + it { is_expected.to eq(120) } + end + context 'with nuber with space' do + let(:value) { " 120 " } + it { is_expected.to eq(120) } + end + end end