Skip to content

Commit 7e4e3f1

Browse files
committed
Change the deleteXXX mojolicious tests.
1 parent e620138 commit 7e4e3f1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

t/mojolicious/008_problems.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,8 @@ $t->delete_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem
185185
$t->get_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem->{set_problem_id}")->status_is(500)
186186
->json_is('/exception' => 'DB::Exception::SetProblemNotFound');
187187

188+
# And check that the problem is no longer in the db.
189+
$t->get_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem->{set_problem_id}")->status_is(500)
190+
->json_is('/exception' => 'DB::Exception::SetProblemNotFound');
191+
188192
done_testing;

t/mojolicious/009_user_problems.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ $t->get_ok(
247247
"/webwork3/api/courses/4/sets/$hw1->{set_id}/users/$ralph->{user_id}/problems/$new_user_problem->{user_problem_id}")
248248
->status_is(500)->json_is('/exception' => 'DB::Exception::UserProblemNotFound');
249249

250+
# And check that the user problem is no longer in the db.
251+
$t->get_ok(
252+
"/webwork3/api/courses/4/sets/$hw1->{set_id}/users/$ralph->{user_id}/problems/$new_user_problem->{user_problem_id}")
253+
->status_is(500)->json_is('/exception' => 'DB::Exception::UserProblemNotFound');
254+
250255
# Delete the added problem
251256

252257
$t->delete_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem->{set_problem_id}")->status_is(200)
@@ -256,4 +261,8 @@ $t->delete_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem
256261
$t->get_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem->{set_problem_id}")->status_is(500)
257262
->json_is('/exception' => 'DB::Exception::SetProblemNotFound');
258263

264+
# And check that the problem is no longer in the db.
265+
$t->get_ok("/webwork3/api/courses/4/sets/$hw1->{set_id}/problems/$new_problem->{set_problem_id}")->status_is(500)
266+
->json_is('/exception' => 'DB::Exception::SetProblemNotFound');
267+
259268
done_testing;

0 commit comments

Comments
 (0)