normalize boolean values (#8320)
* extract parent for yes no and checkbox champs * checkbox stores true / false instead of on / off * normalize blank value to nil * normalize invalid value to false * after party task: normalize checkbox values * after party task: normalize yes_no values
This commit is contained in:
parent
22ecbc2ffb
commit
fa6fc077b4
25 changed files with 292 additions and 101 deletions
|
@ -65,7 +65,7 @@ RSpec.describe Types::DossierType, type: :graphql do
|
|||
let(:dossier) { create(:dossier, :accepte, :with_populated_champs, procedure: procedure) }
|
||||
let(:query) { DOSSIER_WITH_CHAMPS_QUERY }
|
||||
let(:variables) { { number: dossier.id } }
|
||||
let(:checkbox_value) { 'on' }
|
||||
let(:checkbox_value) { 'true' }
|
||||
|
||||
before do
|
||||
dossier.champs_public.first.update(value: checkbox_value)
|
||||
|
@ -78,7 +78,7 @@ RSpec.describe Types::DossierType, type: :graphql do
|
|||
end
|
||||
|
||||
context 'when checkbox is false' do
|
||||
let(:checkbox_value) { 'off' }
|
||||
let(:checkbox_value) { 'false' }
|
||||
it { expect(data[:dossier][:champs].size).to eq 1 }
|
||||
it { expect(data[:dossier][:champs][0][:__typename]).to eq "CheckboxChamp" }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue