assertTrue(u.hasValidTTPAgentChallenge());
}
+ @Test
+ public void testHasContract() throws GigiApiException {
+ assertEquals(false, Contract.hasSignedContract(u, Contract.ContractType.RA_AGENT_CONTRACT));
+
+ Contract c = new Contract(u, Contract.ContractType.RA_AGENT_CONTRACT);
+ getMailReceiver().receive(u.getEmail());
+ assertEquals(true, Contract.hasSignedContract(u, Contract.ContractType.RA_AGENT_CONTRACT));
+
+ c.revokeContract();
+ getMailReceiver().receive(u.getEmail());
+ assertEquals(false, Contract.hasSignedContract(u, Contract.ContractType.RA_AGENT_CONTRACT));
+ }
+
@Test
public void testWriteUserLog() throws GigiApiException {
String type = "Log test";
assertThat(result, ArrayContains.contains(CoreMatchers.equalTo(type)));
}
+ @Test
+ public void testValidVerification() throws GigiApiException {
+ User u0 = User.getById(createVerifiedUser("f", "l", createUniqueName() + "@email.com", TEST_PASSWORD));
+ assertFalse(u0.isValidNameVerification(u0.getPreferredName().toString()));
+
+ add100Points(u0.getId());
+ assertTrue(u0.isValidNameVerification(u0.getPreferredName().toString()));
+
+ setVerificationDateToPast(u0.getPreferredName());
+ assertFalse(u0.isValidNameVerification(u0.getPreferredName().toString()));
+
+ add100Points(u0.getId());
+ assertTrue(u0.isValidNameVerification(u0.getPreferredName().toString()));
+ }
+
}