Search in sources :

Example 1 with SignClaForm

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;
}
Also used : SignClaForm(io.pivotal.cla.mvc.SignClaForm)

Example 2 with SignClaForm

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);
}
Also used : SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 3 with SignClaForm

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();
}
Also used : SignClaForm(io.pivotal.cla.mvc.SignClaForm) Form(io.pivotal.cla.webdriver.pages.SignIclaPage.Form) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 4 with SignClaForm

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);
}
Also used : SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 5 with SignClaForm

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();
}
Also used : SignClaForm(io.pivotal.cla.mvc.SignClaForm) Form(io.pivotal.cla.webdriver.pages.SignIclaPage.Form) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Aggregations

SignClaForm (io.pivotal.cla.mvc.SignClaForm)9 SignIclaPage (io.pivotal.cla.webdriver.pages.SignIclaPage)8 Test (org.junit.Test)8 Form (io.pivotal.cla.webdriver.pages.SignIclaPage.Form)4