File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1414 validations :
1515 school :
1616 website : " must be a valid URL"
17- school_roll_number : " must be alphanumeric (e.g., 01572D)"
17+ school_roll_number : " must be numbers followed by letters (e.g., 01572D)"
1818 invitation :
1919 email_address : " '%<value>s' is invalid"
2020 activerecord :
Original file line number Diff line number Diff line change 167167 expect ( school ) . to be_valid
168168 end
169169
170- it 'accepts a school_roll_number with multiple letters' do
170+ it 'accepts a school_roll_number with one or more letters' do
171171 school . school_roll_number = '12345ABC'
172172 expect ( school ) . to be_valid
173173 end
174174
175175 it 'rejects a school_roll_number with only numbers' do
176176 school . school_roll_number = '01572'
177177 expect ( school ) . not_to be_valid
178- expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be alphanumeric (e.g., 01572D)' )
178+ expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be numbers followed by letters (e.g., 01572D)' )
179179 end
180180
181181 it 'rejects a school_roll_number with only letters' do
182182 school . school_roll_number = 'ABCDE'
183183 expect ( school ) . not_to be_valid
184- expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be alphanumeric (e.g., 01572D)' )
184+ expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be numbers followed by letters (e.g., 01572D)' )
185185 end
186186
187187 it 'rejects a school_roll_number with special characters' do
188188 school . school_roll_number = '01572-D'
189189 expect ( school ) . not_to be_valid
190- expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be alphanumeric (e.g., 01572D)' )
190+ expect ( school . errors [ :school_roll_number ] ) . to include ( 'must be numbers followed by letters (e.g., 01572D)' )
191191 end
192192
193193 it 'normalizes blank school_roll_number to nil' do
You can’t perform that action at this time.
0 commit comments