X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Fwot%2FTestVerification.java;h=dcc61fc070cf66d857ec173546001b527c415e01;hb=47459b4c744dc5e3d7eda51e6af98aff09679505;hp=9ad541a383bc18effb800060dfde0f242891b5aa;hpb=3a9e6d9125191a9010bbb04051fdef8e9fa014d1;p=gigi.git diff --git a/tests/club/wpia/gigi/pages/wot/TestVerification.java b/tests/club/wpia/gigi/pages/wot/TestVerification.java index 9ad541a3..dcc61fc0 100644 --- a/tests/club/wpia/gigi/pages/wot/TestVerification.java +++ b/tests/club/wpia/gigi/pages/wot/TestVerification.java @@ -399,9 +399,27 @@ public class TestVerification extends ManagedTest { public void testVerifyWithoutValidChallenge() throws IOException, GigiApiException { cookie = cookieWithCertificateLogin(User.getById(applicantId)); add100Points(applicantId); + insertRAContract(applicantId); addChallengeInPast(applicantId, CATSType.AGENT_CHALLENGE); assertEquals(403, get(cookie, VerifyPage.PATH).getResponseCode()); addChallenge(applicantId, CATSType.AGENT_CHALLENGE); assertEquals(200, get(cookie, VerifyPage.PATH).getResponseCode()); } + + @Test + public void testVerifyValidTTPChallenge() throws IOException, GigiApiException { + grant(User.getByEmail(agentM), Group.TTP_AGENT); + grant(User.getById(applicantId), Group.TTP_APPLICANT); + cookie = cookieWithCertificateLogin(User.getById(applicantId)); + cookie = cookieWithCertificateLogin(User.getByEmail(agentM)); + + // test without valid challenge + String content = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1910"); + assertThat(content, containsString("you need to pass the TTP RA Agent Challenge")); + + // test with valid challenge + addChallenge(User.getByEmail(agentM).getId(), CATSType.TTP_AGENT_CHALLENGE); + content = search("email=" + URLEncoder.encode(applicantM, "UTF-8") + "&day=1&month=1&year=1910"); + assertThat(content, not(containsString("you need to pass the TTP RA Agent Challenge"))); + } }