File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
app/controllers/teacher_interface
spec/system/teacher_interface Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,16 @@ def destroy
227
227
)
228
228
229
229
if @form . save ( validate : true )
230
- redirect_to %i[ check teacher_interface application_form work_histories ]
230
+ if application_form . work_histories . none?
231
+ redirect_to %i[ new teacher_interface application_form work_history ]
232
+ else
233
+ redirect_to %i[
234
+ check
235
+ teacher_interface
236
+ application_form
237
+ work_histories
238
+ ]
239
+ end
231
240
else
232
241
send_errors_to_big_query ( @form )
233
242
Original file line number Diff line number Diff line change 71
71
when_i_delete_work_history
72
72
then_i_see_the ( :teacher_check_work_histories_page )
73
73
and_i_see_two_work_histories
74
+
75
+ when_i_click_delete_work_history
76
+ then_i_see_the ( :teacher_delete_work_history_page )
77
+
78
+ when_i_delete_work_history
79
+ then_i_see_the ( :teacher_check_work_histories_page )
80
+ and_i_see_one_work_history
81
+
82
+ when_i_click_delete_work_history
83
+ then_i_see_the ( :teacher_delete_work_history_page )
84
+
85
+ when_i_delete_work_history
86
+ then_i_see_the ( :teacher_new_work_history_page )
74
87
end
75
88
76
89
private
@@ -262,6 +275,10 @@ def and_i_see_two_work_histories
262
275
expect ( teacher_check_work_histories_page . summary_cards . count ) . to eq ( 2 )
263
276
end
264
277
278
+ def and_i_see_one_work_history
279
+ expect ( teacher_check_work_histories_page . summary_cards . count ) . to eq ( 1 )
280
+ end
281
+
265
282
def teacher
266
283
@teacher ||= create ( :teacher )
267
284
end
You can’t perform that action at this time.
0 commit comments