File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,13 @@ def normalize_district_fields
108108 end
109109
110110 # Ensure the school_roll_number is nil, not an empty string
111+ # Also normalize to uppercase for consistent validation
111112 def normalize_school_roll_number
112- self . school_roll_number = nil if school_roll_number . blank?
113+ if school_roll_number . blank?
114+ self . school_roll_number = nil
115+ else
116+ self . school_roll_number = school_roll_number . upcase
117+ end
113118 end
114119
115120 def verified_at_cannot_be_changed
Original file line number Diff line number Diff line change 196196 expect ( school . school_roll_number ) . to be_nil
197197 end
198198
199+ it 'normalizes school_roll_number to uppercase' do
200+ school . school_roll_number = '01572d'
201+ school . save
202+ expect ( school . school_roll_number ) . to eq ( '01572D' )
203+ end
204+
199205 it 'requires an address_line_1' do
200206 school . address_line_1 = ' '
201207 expect ( school ) . not_to be_valid
You can’t perform that action at this time.
0 commit comments