From 3abaeba76b6f7355134af282091aa36945f52909 Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 31 Dec 2024 15:36:28 +0100 Subject: [PATCH] Add test for old expiresAt date in integration --- cmd/web/main_integration.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmd/web/main_integration.go b/cmd/web/main_integration.go index 58734bd..e057cbb 100644 --- a/cmd/web/main_integration.go +++ b/cmd/web/main_integration.go @@ -173,6 +173,22 @@ func runCreateElectionTests() { "choices": [ "Gandhi" ] +}`), + Expect().Status().Equal(http.StatusUnprocessableEntity), + ) + + MustDo( + template, + Send().Body().String(` +{ + "name": "Guy of the year", + "tokens": 100, + "areVotersKnown": false, + "maxVoters": 10, + "expiresAt": "2018-12-31T14:15:22Z", + "choices": [ + "Gandhi" + ] }`), Expect().Status().Equal(http.StatusUnprocessableEntity), )