Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit e265b10

Browse files
committed
Check config when testing GH PR service
1 parent d2d0c50 commit e265b10

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/cc/services/github_pull_requests.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Config < CC::Service::Config
2424
# additional information (github-slug, PR number, etc) we can't test much
2525
# else.
2626
def receive_test
27+
receive_test_status if config.update_status
28+
end
29+
30+
def receive_test_status
2731
setup_http
2832

2933
http_post(base_status_url("0" * 40), "{}")

test/github_pull_requests_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ def test_pull_request_status_success
2727
})
2828
end
2929

30-
def test_pull_request_test_success
30+
def test_pull_request_status_test_success
3131
@stubs.post("/repos/pbrisbin/foo/statuses/#{"0" * 40}") { |env| [422, {}, ""] }
3232

33-
assert receive_test({}, { github_slug: "pbrisbin/foo" })[:ok], "Expected test of pull request to be true"
33+
assert receive_test({ update_status: true }, { github_slug: "pbrisbin/foo" })[:ok], "Expected test of pull request to be true"
3434
end
3535

36-
def test_pull_request_test_failure
36+
def test_pull_request_status_test_failure
3737
@stubs.post("/repos/pbrisbin/foo/statuses/#{"0" * 40}") { |env| [401, {}, ""] }
3838

39-
assert !receive_test({}, { github_slug: "pbrisbin/foo" })[:ok], "Expected failed test of pull request"
39+
assert !receive_test({ update_status: true }, { github_slug: "pbrisbin/foo" })[:ok], "Expected failed test of pull request"
4040
end
4141

4242
def test_pull_request_comment

0 commit comments

Comments
 (0)