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
|
@ -134,16 +134,16 @@ describe ChampSerializer do
|
|||
end
|
||||
|
||||
context 'when type champ checkbox' do
|
||||
context 'on' do
|
||||
let(:champ) { create(:champ_checkbox, value: 'on') }
|
||||
context 'true' do
|
||||
let(:champ) { create(:champ_checkbox, value: 'true') }
|
||||
|
||||
it { is_expected.to include(value: 'on') }
|
||||
it { is_expected.to include(value: 'true') }
|
||||
end
|
||||
|
||||
context 'off' do
|
||||
let(:champ) { create(:champ_checkbox, value: 'off') }
|
||||
context 'false' do
|
||||
let(:champ) { create(:champ_checkbox, value: 'false') }
|
||||
|
||||
it { is_expected.to include(value: 'off') }
|
||||
it { is_expected.to include(value: 'false') }
|
||||
end
|
||||
|
||||
context 'nil' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue