Skip to content

Commit ddf5a0d

Browse files
committed
Fixing isPullRequestMerged and other is* predicates by changing expectation to http 204 instead of 202
1 parent 2353807 commit ddf5a0d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

spec/GitHub/PullRequestsSpec.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module GitHub.PullRequestsSpec where
44

55
import qualified GitHub
6+
import GitHub.Data.Id (Id(Id))
67

78
import Prelude ()
89
import Prelude.Compat
@@ -50,6 +51,13 @@ spec = do
5051

5152
V.length (GitHub.pullRequestRequestedReviewers pullRequestReviewRequested)
5253
`shouldBe` 1
54+
55+
describe "checking if a pull request is merged" $ do
56+
it "works" $ withAuth $ \auth -> do
57+
b <- GitHub.executeRequest auth $ GitHub.isPullRequestMergedR "phadej" "github" (Id 14)
58+
b `shouldSatisfy` isRight
59+
fromRightS b `shouldBe` True
60+
5361
where
5462
repos =
5563
[ ("thoughtbot", "paperclip")

src/GitHub/Data/Request.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ type StatusMap a = [(Int, a)]
158158

159159
statusOnlyOk :: StatusMap Bool
160160
statusOnlyOk =
161-
[ (202, True)
161+
[ (204, True)
162162
, (404, False)
163163
]
164164

0 commit comments

Comments
 (0)