use of io.pivotal.cla.webdriver.pages.SignIclaPage in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signNoRepositoryIdAndNoPullRequestId.
@Test
public void signNoRepositoryIdAndNoPullRequestId() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
signPage = signPage.form(defaultClaForm()).confirm().sign(SignIclaPage.class);
signPage.assertAt();
verifyZeroInteractions(mockGitHub);
}
use of io.pivotal.cla.webdriver.pages.SignIclaPage 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.webdriver.pages.SignIclaPage 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.webdriver.pages.SignIclaPage 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.webdriver.pages.SignIclaPage in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signForm.
@Test
public void signForm() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
signPage.assertClaLink(cla.getName());
assertThat(signPage.getIndividualCla()).isEqualTo(cla.getIndividualContent().getHtml());
assertThat(signPage.isSigned()).isFalse();
}
Aggregations