This repository was archived by the owner on Jul 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def receive_pull_request
44
44
setup_http
45
45
state = @payload [ "state" ]
46
46
47
- if %w( pending success skipped error ) . include? ( state )
47
+ if %w[ pending success failure skipped error ] . include? ( state )
48
48
send ( "update_status_#{ state } " )
49
49
else
50
50
@response = simple_failure ( "Unknown state" )
@@ -75,6 +75,11 @@ def update_status_success
75
75
update_status ( "success" , presenter . success_message )
76
76
end
77
77
78
+ def update_status_failure
79
+ add_comment
80
+ update_status ( "failure" , presenter . success_message )
81
+ end
82
+
78
83
def presenter
79
84
CC ::Service ::GitHubPullRequestsPresenter . new ( @payload )
80
85
end
Original file line number Diff line number Diff line change @@ -30,6 +30,22 @@ def test_pull_request_status_success_detailed
30
30
)
31
31
end
32
32
33
+ def test_pull_request_status_failure
34
+ expect_status_update ( "pbrisbin/foo" , "abc123" , {
35
+ "state" => "failure" ,
36
+ "description" => "Code Climate found 2 new issues and 1 fixed issue." ,
37
+ } )
38
+
39
+ receive_pull_request (
40
+ { update_status : true } ,
41
+ {
42
+ github_slug : "pbrisbin/foo" ,
43
+ commit_sha : "abc123" ,
44
+ state : "failure"
45
+ }
46
+ )
47
+ end
48
+
33
49
def test_pull_request_status_success_generic
34
50
expect_status_update ( "pbrisbin/foo" , "abc123" , {
35
51
"state" => "success" ,
You can’t perform that action at this time.
0 commit comments