File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 11class Service ::Tender < Service
2+ # mysite.tenderapp.com
23 string :domain
4+
5+ # tracker token. can be found here:
6+ # http://mysite.tenderapp.com/settings/trackers
37 password :token
4- default_events :issues
8+
9+ default_events :issues , :pull_request
10+
11+ url 'https://tenderapp.com'
12+ logo_url 'https://tenderapp.com/images/logo.jpg'
13+
14+ # julien on http://help.tenderapp.com/home
15+ maintained_by :github => 'calexicoz'
16+
17+ # Support channels for user-level Hook problems (service failure, misconfigured)
18+ supported_by :web => 'http://help.tenderapp.com/home' ,
19+ 520
621 def receive_issues
722 raise_config_error 'Missing token' if data [ 'token' ] . to_s . empty?
Original file line number Diff line number Diff line change @@ -30,7 +30,31 @@ def test_issues
3030 service ( :issues , @options , issues_payload ) . receive_issues
3131 end
3232
33+ def test_pull
34+ @stubs . post "/tickets/github/Aewi5ui1" do |env |
35+ puts env [ :body ]
36+ body = JSON . parse ( env [ :body ] )
37+
38+ assert_equal 'https' , env [ :url ] . scheme
39+ assert !env [ :ssl ] [ :verify ]
40+ assert_equal 'some.tenderapp.com' , env [ :url ] . host
41+ assert_equal 'application/json' , env [ :request_headers ] [ 'Content-Type' ]
42+
43+ assert_equal body [ "pull_request" ] [ "state" ] , "open"
44+ assert_equal body [ "pull_request" ] [ "number" ] , 5
45+ assert_equal body [ "repository" ] [ "name" ] , "grit"
46+ assert_equal body [ "repository" ] [ "owner" ] [ "login" ] , "mojombo"
47+
48+ [ 200 , { } , '' ]
49+ end
50+
51+ service ( :pull_request , @options , pull_payload ) . receive_pull_request
52+ end
53+
54+ private
55+
3356 def service ( *args )
3457 super Service ::Tender , *args
3558 end
59+
3660end
You can’t perform that action at this time.
0 commit comments