From 7bbff5247ab73a795555e2d4a07231064a718f40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Tue, 15 Aug 2017 21:37:13 +0200 Subject: [PATCH] upd: more verbose success message after verification Change-Id: Id6ab26cebe97bc140a326a58ddfbcf1ccd446dcf --- src/club/wpia/gigi/pages/wot/VerificationForm.java | 3 ++- tests/club/wpia/gigi/pages/wot/TestVerification.java | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/club/wpia/gigi/pages/wot/VerificationForm.java b/src/club/wpia/gigi/pages/wot/VerificationForm.java index 6a785c0c..77f2be09 100644 --- a/src/club/wpia/gigi/pages/wot/VerificationForm.java +++ b/src/club/wpia/gigi/pages/wot/VerificationForm.java @@ -217,7 +217,8 @@ public class VerificationForm extends Form { } Notary.verifyAll(agent, applicant, dob, pointsI, location, req.getParameter("date"), type, toVerify.toArray(new Name[toVerify.size()]), cs.getCountry()); - Outputable result = new TranslateCommand("Verification complete."); + + Outputable result = SprintfCommand.createSimple("Verification of user with email address {0} and {1} verification points complete.", applicant.getEmail(), points); if (isWithPasswordReset()) { Language langApplicant = Language.getInstance(applicant.getPreferredLocale()); String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by verification, please enter your secret password using this form:"); diff --git a/tests/club/wpia/gigi/pages/wot/TestVerification.java b/tests/club/wpia/gigi/pages/wot/TestVerification.java index ef37f598..7a6aed4e 100644 --- a/tests/club/wpia/gigi/pages/wot/TestVerification.java +++ b/tests/club/wpia/gigi/pages/wot/TestVerification.java @@ -98,7 +98,9 @@ public class TestVerification extends ManagedTest { @Test public void testVerifyForm() throws IOException { - executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + String body = executeSuccess("date=" + validVerificationDateString() + "&location=testcase&countryCode=DE&certify=1&rules=1&assertion=1&points=10"); + assertThat(body, containsString("10")); + assertThat(body, containsString(applicantM)); } @Test @@ -259,9 +261,10 @@ public class TestVerification extends ManagedTest { } - private void executeSuccess(String query) throws MalformedURLException, IOException { - assertThat(execute(query), hasNoError()); - + private String executeSuccess(String query) throws MalformedURLException, IOException { + String response = execute(query); + assertThat(response, hasNoError()); + return response; } private String execute(String query) throws MalformedURLException, IOException { -- 2.39.2