use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method defaultClaForm.
private static SignClaForm defaultClaForm() {
SignClaForm form = new SignClaForm();
form.setCountry("USA");
form.setName("Rob Winch");
form.setEmail("rob@gmail.com");
form.setMailingAddress("123 Seasame St");
form.setTelephone("123.456.7890");
return form;
}
use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signMailingAddressNotRequired.
@Test
public void signMailingAddressNotRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm form = defaultClaForm();
form.setMailingAddress("");
signPage = signPage.form(form).confirm().sign(SignIclaPage.class);
signPage.assertAt();
assertThatClaIsSigned(form);
}
use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signConfirmRequired.
@Test
public void signConfirmRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm claForm = defaultClaForm();
signPage = signPage.form(claForm).sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasRequiredError();
}
use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method sign.
@Test
public void sign() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm form = defaultClaForm();
signPage = signPage.form(form).confirm().sign(SignIclaPage.class);
signPage.assertAt();
assertThatClaIsSigned(form);
}
use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signEmailRequired.
@Test
public void signEmailRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm claForm = defaultClaForm();
signPage = signPage.form(claForm).email("").confirm().sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasRequiredError();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
Aggregations