use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.
the class EditAdminClaTests method editClaInvalidPrimary.
@Test
public void editClaInvalidPrimary() throws Exception {
ContributorLicenseAgreement springCla = DataUtils.createSpringCla();
springCla.setId(54321L);
springCla.setSupersedingCla(cla);
when(mockClaRepository.findAll()).thenReturn(Arrays.asList(cla, springCla));
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
when(mockClaRepository.findOne(springCla.getId())).thenReturn(springCla);
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
AdminEditClaPage create = AdminEditClaPage.to(getDriver(), springCla.getId());
create = create.form().name(cla.getName()).primary().submit(AdminEditClaPage.class);
ClaForm form = create.form();
form.assertPrimary().hasError("A primary CLA with this name already exists");
}
use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.
the class EditAdminClaTests method editClaRequiredFieldsNameRequired.
@Test
public void editClaRequiredFieldsNameRequired() throws Exception {
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
create = create.form().name("").submit(AdminEditClaPage.class);
ClaForm form = create.form();
form.assertName().hasRequiredError();
form.assertIndividualContent().hasNoErrors().hasValue(cla.getIndividualContent().getMarkdown());
form.assertCorporateContent().hasNoErrors().hasValue(cla.getCorporateContent().getMarkdown());
}
use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.
the class EditAdminClaTests method editClaRequiredFieldsIndividualRequired.
@Test
public void editClaRequiredFieldsIndividualRequired() throws Exception {
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
create = create.form().individual("").submit(AdminEditClaPage.class);
ClaForm form = create.form();
form.assertName().hasNoErrors().hasValue(cla.getName());
form.assertCorporateContent().hasNoErrors();
form.assertIndividualContent().hasRequiredError();
}
use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.
the class EditAdminClaTests method editClaRequiredFieldsAll.
@Test
public void editClaRequiredFieldsAll() throws Exception {
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
AdminEditClaPage edit = AdminEditClaPage.to(getDriver(), cla.getId());
edit = edit.form().name("").individual("").corporate("").submit(AdminEditClaPage.class);
ClaForm form = edit.form();
form.assertName().hasRequiredError();
form.assertIndividualContent().hasRequiredError();
form.assertCorporateContent().hasRequiredError();
}
use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.
the class EditAdminClaTests method editClaRequiredFieldsCorporateRequired.
@Test
public void editClaRequiredFieldsCorporateRequired() throws Exception {
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
create = create.form().corporate("").submit(AdminEditClaPage.class);
ClaForm form = create.form();
form.assertName().hasNoErrors();
form.assertIndividualContent().hasNoErrors();
form.assertCorporateContent().hasRequiredError();
}
Aggregations