Skip to content

Commit 7ab9971

Browse files
Wong-ZZangelsl
authored andcommitted
Updated tests when changing assessment opening/closing date
1 parent bb77f2c commit 7ab9971

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/cadet_web/controllers/assessments_controller_test.exs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ defmodule CadetWeb.AssessmentsControllerTest do
15021502
end
15031503

15041504
@tag authenticate: :staff
1505-
test "not allowed to set close time to before current time", %{conn: conn} do
1505+
test "successful, set close time to before current time", %{conn: conn} do
15061506
open_at =
15071507
Timex.now()
15081508
|> Timex.beginning_of_day()
@@ -1531,12 +1531,12 @@ defmodule CadetWeb.AssessmentsControllerTest do
15311531
|> post(build_url_update(assessment.id), new_dates)
15321532

15331533
assessment = Repo.get(Assessment, assessment.id)
1534-
assert response(conn, 400) == "New end date should occur after current time"
1535-
assert [assessment.open_at, assessment.close_at] == [open_at, close_at]
1534+
assert response(conn, 200) == "OK"
1535+
assert [assessment.open_at, assessment.close_at] == [open_at, new_close_at]
15361536
end
15371537

15381538
@tag authenticate: :staff
1539-
test "not allowed to set open time to before current time", %{conn: conn} do
1539+
test "successful, set open time to before current time", %{conn: conn} do
15401540
open_at =
15411541
Timex.now()
15421542
|> Timex.beginning_of_day()
@@ -1565,8 +1565,8 @@ defmodule CadetWeb.AssessmentsControllerTest do
15651565
|> post(build_url_update(assessment.id), new_dates)
15661566

15671567
assessment = Repo.get(Assessment, assessment.id)
1568-
assert response(conn, 400) == "New Opening date should occur after current time"
1569-
assert [assessment.open_at, assessment.close_at] == [open_at, close_at]
1568+
assert response(conn, 200) == "OK"
1569+
assert [assessment.open_at, assessment.close_at] == [new_open_at, close_at]
15701570
end
15711571
end
15721572

0 commit comments

Comments
 (0)