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 +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ def receive_quality
3333 create_story ( name , details_url )
3434 end
3535
36+ def receive_issue
37+ title = %{Fix "#{ issue [ "check_name" ] } " issue in #{ constant_name } }
38+
39+ body = [ issue [ "description" ] , details_url ] . join ( "\n \n " )
40+
41+ create_story ( title , body )
42+ end
43+
3644 def receive_vulnerability
3745 formatter = CC ::Formatters ::TicketFormatter . new ( self )
3846
Original file line number Diff line number Diff line change @@ -23,6 +23,23 @@ def test_vulnerability
2323 )
2424 end
2525
26+ def test_issue
27+ payload = {
28+ issue : {
29+ "check_name" => "Style/LongLine" ,
30+ "description" => "Line is too long [1000/80]"
31+ } ,
32+ constant_name : "foo.rb" ,
33+ details_url : "http://example.com/repos/id/foo.rb#issue_123"
34+ }
35+
36+ assert_pivotal_receives (
37+ event ( :issue , payload ) ,
38+ "Fix \" Style/LongLine\" issue in foo.rb" ,
39+ "Line is too long [1000/80]\n \n http://example.com/repos/id/foo.rb#issue_123"
40+ )
41+ end
42+
2643 def test_receive_test
2744 @stubs . post 'services/v3/projects/123/stories' do |env |
2845 [ 200 , { } , '<story><id>123</id><url>http://foo.bar</url></story>' ]
You can’t perform that action at this time.
0 commit comments