Support new label names containing colons

This commit is contained in:
Andy Wilkinson
2017-01-10 11:37:29 -05:00
parent 09d542c175
commit dfa379328f
4 changed files with 24 additions and 5 deletions

View File

@@ -179,6 +179,17 @@ public class GitHubTemplateTests {
assertThat(modifiedIssue.getLabels(), hasSize(0));
}
@Test
public void removeLabelWithNameThatRequiresEncodingFromIssue() {
this.server.expect(requestTo("labels/status:%20foo")).andExpect(method(HttpMethod.DELETE))
.andExpect(basicAuth())
.andRespond(withSuccess("[]", MediaType.APPLICATION_JSON));
Issue issue = new Issue(null, null, null, "labels{/name}", null, null, null,
null);
Issue modifiedIssue = this.gitHub.removeLabel(issue, "status: foo");
assertThat(modifiedIssue.getLabels(), hasSize(0));
}
@Test
public void addCommentToIssue() {
this.server.expect(requestTo("commentsUrl")).andExpect(method(HttpMethod.POST))