Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Make body: Option[String] #200

Merged
merged 1 commit into from
Mar 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case class PullRequest(
number: Int,
state: String,
title: String,
body: String,
body: Option[String],
locked: Boolean,
html_url: String,
created_at: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ trait GHPullRequestsSpec[T] extends BaseIntegrationSpec[T] {
})
}

"PullRequests >> List" should "return a right response when a valid repo is provided but not all pull requests have body" in {
val response =
Github(accessToken).pullRequests
.list("lloydmeta", "gh-test-repo", List(PRFilterOpen))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope you're not planning on changing this anytime soon 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL, yeah, I made that repo just so there would be zero chance of it changing :)

.execFuture[T](headerUserAgent)

testFutureIsRight[List[PullRequest]](response, { r =>
r.result.nonEmpty shouldBe true
r.statusCode shouldBe okStatusCode
})
}

it should "return a non empty list when valid repo and some filters are provided" in {
val response =
Github(accessToken).pullRequests
Expand Down Expand Up @@ -73,7 +85,7 @@ trait GHPullRequestsSpec[T] extends BaseIntegrationSpec[T] {

"PullRequests >> ListFiles" should "return a right response when a valid repo is provided and not all files have 'patch'" in {
val response =
Github(None).pullRequests
Github(accessToken).pullRequests
.listFiles("scala", "scala", 4877)
.execFuture[T](headerUserAgent)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ trait TestData extends DummyGithubUrls {
number = validPullRequestNumber,
state = "open",
title = "Title",
body = "Body",
body = Some("Body"),
locked = false,
html_url = githubApiUrl,
created_at = "2011-04-10T20:09:31Z",
Expand Down