@@ -151,22 +151,22 @@ def when_i_click_the_text_task_list_item
151
151
expect (
152
152
teacher_further_information_required_page . failure_reason_heading . text ,
153
153
) . to eq (
154
- "The subjects you entered are acceptable for QTS, but the uploaded qualifications do not match them. " ,
154
+ "The subjects you entered are acceptable for QTS, but the uploaded qualifications do not match them" ,
155
155
)
156
156
end
157
157
158
158
def when_i_click_the_work_history_contact_task_list_item
159
159
work_history_task_list_item . click
160
160
expect (
161
161
teacher_further_information_required_page . failure_reason_heading . text ,
162
- ) . to eq ( "We could not verify 1 or more references you provided. " )
162
+ ) . to eq ( "We could not verify 1 or more references you provided" )
163
163
end
164
164
165
165
def when_i_click_the_document_task_list_item
166
166
document_task_list_item . click
167
167
expect (
168
168
teacher_further_information_required_page . failure_reason_heading . text ,
169
- ) . to eq ( "Your ID document is illegible or in a format we cannot accept. " )
169
+ ) . to eq ( "Your ID document is illegible or in a format we cannot accept" )
170
170
end
171
171
172
172
def when_i_fill_in_the_response
@@ -208,25 +208,21 @@ def when_i_click_the_check_your_answers_task_list_item
208
208
end
209
209
210
210
def check_your_answers_task_list_item
211
- teacher_further_information_requested_page . task_list . find_item (
211
+ teacher_further_information_requested_page . task_lists . last . find_item (
212
212
"Check your answers before submitting" ,
213
213
)
214
214
end
215
215
216
216
def and_i_see_the_check_your_answers_items
217
- rows =
218
- teacher_check_further_information_request_answers_page . summary_list . rows
217
+ lists = teacher_check_further_information_request_answers_page . summary_lists
219
218
220
- expect ( rows . count ) . to eq ( 3 )
219
+ expect ( lists . count ) . to eq ( 3 )
221
220
222
- expect ( rows . first . key . text ) . to eq (
223
- "Tell us more about the subjects you can teach" ,
224
- )
225
- expect ( rows . second . key . text ) . to eq (
226
- "Update reference details for #{ application_form . work_histories . first . school_name } " ,
227
- )
228
-
229
- expect ( rows . last . key . text ) . to eq ( "Upload your identity document" )
221
+ expect (
222
+ teacher_check_further_information_request_answers_page ,
223
+ ) . to have_content ( "Your response" ) . and have_content (
224
+ "Reference details" ,
225
+ ) . and have_content ( "Identity documents" )
230
226
end
231
227
232
228
def when_i_click_the_text_check_your_answers_item
@@ -283,11 +279,21 @@ def application_form
283
279
statuses : %w[ waiting_on_further_information ] ,
284
280
teacher :,
285
281
)
286
- create (
287
- :assessment ,
288
- :with_further_information_request ,
289
- application_form :,
290
- )
282
+ assessment =
283
+ create (
284
+ :assessment ,
285
+ :with_further_information_request ,
286
+ application_form :,
287
+ )
288
+ assessment_section =
289
+ create ( :assessment_section , :personal_information , assessment :)
290
+ assessment . further_information_requests . first . items . each do |item |
291
+ create (
292
+ :selected_failure_reason ,
293
+ assessment_section : assessment_section ,
294
+ key : item . failure_reason_key ,
295
+ )
296
+ end
291
297
application_form
292
298
end
293
299
end
@@ -297,35 +303,37 @@ def further_information_request
297
303
end
298
304
299
305
def text_task_list_item
300
- teacher_further_information_requested_page . task_list . find_item (
306
+ teacher_further_information_requested_page . task_lists . first . find_item (
301
307
"Tell us more about the subjects you can teach" ,
302
308
)
303
309
end
304
310
305
311
def text_check_answers_item
306
312
teacher_check_further_information_request_answers_page
307
- . summary_list
313
+ . summary_lists
314
+ . second
308
315
. rows
309
316
. first
310
317
end
311
318
312
319
def work_history_task_list_item
313
- teacher_further_information_requested_page . task_list . find_item (
320
+ teacher_further_information_requested_page . task_lists . first . find_item (
314
321
"Update reference details for #{ application_form . work_histories . first . school_name } " ,
315
322
)
316
323
end
317
324
318
325
def document_task_list_item
319
- teacher_further_information_requested_page . task_list . find_item (
326
+ teacher_further_information_requested_page . task_lists . first . find_item (
320
327
"Upload your identity document" ,
321
328
)
322
329
end
323
330
324
331
def document_check_answers_item
325
332
teacher_check_further_information_request_answers_page
326
- . summary_list
333
+ . summary_lists
334
+ . first
327
335
. rows
328
- . last
336
+ . first
329
337
end
330
338
331
339
def then_i_see_the_warning_text
0 commit comments