use of io.pivotal.cla.webdriver.pages.SignClaPage in project pivotal-cla by pivotalsoftware.
the class ClaControllerTests method learnMoreLink.
@Test
@WithSigningUser
public void learnMoreLink() {
SignClaPage home = SignClaPage.go(driver, cla.getName());
AboutPage aboutPage = home.learnMore();
aboutPage.assertAt();
}
use of io.pivotal.cla.webdriver.pages.SignClaPage in project pivotal-cla by pivotalsoftware.
the class ClaControllerTests method claPivotalSignedWithPullRequest.
@Test
public void claPivotalSignedWithPullRequest() throws Exception {
when(mockIndividualSignatureRepository.findSignaturesFor(any(), eq(WithSigningUserFactory.create()), eq(cla.getName()))).thenReturn(Arrays.asList(individualSignature));
String repositoryId = "spring-projects/spring-security";
int pullRequestId = 123;
SignClaPage home = SignClaPage.go(driver, cla.getName(), repositoryId, pullRequestId);
home.assertAt();
home.assertPullRequestLink(repositoryId, pullRequestId);
}
use of io.pivotal.cla.webdriver.pages.SignClaPage in project pivotal-cla by pivotalsoftware.
the class ClaControllerTests method claPivotalWithPullRequest.
@Test
public void claPivotalWithPullRequest() throws Exception {
String repositoryId = "spring-projects/spring-security";
int pullRequestId = 123;
SignClaPage home = SignClaPage.go(driver, cla.getName(), repositoryId, pullRequestId);
home.assertAt();
home.assertClaLinksWithPullRequest(cla.getName(), repositoryId, pullRequestId);
verify(mockGitHub, never()).save(any(PullRequestStatus.class));
}
use of io.pivotal.cla.webdriver.pages.SignClaPage in project pivotal-cla by pivotalsoftware.
the class ClaControllerTests method viewSignedWithRepositoryIdAndPullRequestIdNewUser.
@Test
@WithAnonymousUser
public void viewSignedWithRepositoryIdAndPullRequestIdNewUser() throws Exception {
String repositoryId = "spring-projects/spring-security";
User signingUser = WithSigningUserFactory.create();
when(mockGitHub.getCurrentUser(any())).thenReturn(signingUser);
when(mockGitHub.getShaForPullRequest(any(PullRequestStatus.class))).thenReturn("abc123");
when(mockIndividualSignatureRepository.findSignaturesFor(any(), eq(signingUser), eq(cla.getName()))).thenReturn(Arrays.asList(individualSignature));
when(mockIndividualSignatureRepository.findSignaturesFor(any(), eq(signingUser))).thenReturn(Arrays.asList(individualSignature));
when(mockTokenRepo.findOne(repositoryId)).thenReturn(new AccessToken(repositoryId, "access-token-123"));
int pullRequestId = 123;
SignClaPage home = SignClaPage.go(driver, cla.getName(), repositoryId, pullRequestId);
home.assertAt();
home.assertClaLinksWithPullRequest(cla.getName(), repositoryId, pullRequestId);
home.assertPullRequestLink(repositoryId, pullRequestId);
home.assertImported();
ArgumentCaptor<PullRequestStatus> updatePullRequestCaptor = ArgumentCaptor.forClass(PullRequestStatus.class);
verify(mockGitHub).save(updatePullRequestCaptor.capture());
PullRequestStatus updatePr = updatePullRequestCaptor.getValue();
String commitStatusUrl = "http://localhost/sign/" + cla.getName() + "?repositoryId=" + repositoryId + "&pullRequestId=" + pullRequestId;
assertThat(updatePr.getUrl()).isEqualTo(commitStatusUrl);
assertThat(updatePr.getGitHubUsername()).isEqualTo(signingUser.getGitHubLogin());
assertThat(updatePr.getPullRequestId()).isEqualTo(pullRequestId);
assertThat(updatePr.getRepoId()).isEqualTo(repositoryId);
}
use of io.pivotal.cla.webdriver.pages.SignClaPage in project pivotal-cla by pivotalsoftware.
the class HomeControllerTests method signCcla.
@Test
@WithSigningUser
public void signCcla() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
SignClaPage home = HomePage.go(driver);
SignCclaPage sign = home.signCcla(SignCclaPage.class);
sign.assertAt();
}
Aggregations