@@ -181,7 +181,6 @@ func TestBadSignatureMatch(t *testing.T) {
181
181
}
182
182
183
183
func TestCommitCommentEvent (t * testing.T ) {
184
-
185
184
payload := `{
186
185
"action": "created",
187
186
"comment": {
@@ -4763,137 +4762,160 @@ func TestPullRequestReviewCommentEvent(t *testing.T) {
4763
4762
func TestPushEvent (t * testing.T ) {
4764
4763
4765
4764
payload := `{
4766
- "ref": "refs/heads/changes ",
4767
- "before": "9049f1265b7d61be4a8904a9a27120d2064dab3b ",
4768
- "after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c ",
4765
+ "ref": "refs/heads/master ",
4766
+ "before": "737d38c599c1b2991664dfc6155d6bf516fcce36 ",
4767
+ "after": "fd489864e7642b48eaad6e3f155c10e46810ec72 ",
4769
4768
"created": false,
4770
4769
"deleted": false,
4771
4770
"forced": false,
4772
4771
"base_ref": null,
4773
- "compare": "https://github.com/baxterthehacker/public-repo /compare/9049f1265b7d ...0d1a26e67d8f ",
4772
+ "compare": "https://github.com/binkkatal/sample_app /compare/737d38c599c1 ...fd489864e764 ",
4774
4773
"commits": [
4775
4774
{
4776
- "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c ",
4777
- "tree_id": "f9d2a07e9488b91af2641b26b9407fe22a451433 ",
4775
+ "id": "fd489864e7642b48eaad6e3f155c10e46810ec72 ",
4776
+ "tree_id": "55e08136e14d5168b699038f88c73e175ddffd3b ",
4778
4777
"distinct": true,
4779
- "message": "Update README.md ",
4780
- "timestamp": "2015-05-05T19:40:15-04:00 ",
4781
- "url": "https://github.com/baxterthehacker/public-repo /commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c ",
4778
+ "message": "test a push event ",
4779
+ "timestamp": "2018-06-29T19:34:13+05:30 ",
4780
+ "url": "https://github.com/binkkatal/sample_app /commit/fd489864e7642b48eaad6e3f155c10e46810ec72 ",
4782
4781
"author": {
4783
- "name": "baxterthehacker ",
4784
-
4785
- "username": "baxterthehacker "
4782
+ "name": "binkkatal ",
4783
+ "email": "binkkatal.r@gmail .com",
4784
+ "username": "binkkatal "
4786
4785
},
4787
4786
"committer": {
4788
- "name": "baxterthehacker ",
4789
-
4790
- "username": "baxterthehacker "
4787
+ "name": "binkkatal ",
4788
+ "email": "binkkatal.r@gmail .com",
4789
+ "username": "binkkatal "
4791
4790
},
4792
4791
"added": [
4793
-
4792
+ ".razorops.yaml"
4794
4793
],
4795
4794
"removed": [
4796
4795
4797
4796
],
4798
4797
"modified": [
4799
- "README.md "
4798
+ "app/controllers/application_controller.rb "
4800
4799
]
4801
4800
}
4802
4801
],
4803
4802
"head_commit": {
4804
- "id": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c ",
4805
- "tree_id": "f9d2a07e9488b91af2641b26b9407fe22a451433 ",
4803
+ "id": "fd489864e7642b48eaad6e3f155c10e46810ec72 ",
4804
+ "tree_id": "55e08136e14d5168b699038f88c73e175ddffd3b ",
4806
4805
"distinct": true,
4807
- "message": "Update README.md ",
4808
- "timestamp": "2015-05-05T19:40:15-04:00 ",
4809
- "url": "https://github.com/baxterthehacker/public-repo /commit/0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c ",
4806
+ "message": "test a push event ",
4807
+ "timestamp": "2018-06-29T19:34:13+05:30 ",
4808
+ "url": "https://github.com/binkkatal/sample_app /commit/fd489864e7642b48eaad6e3f155c10e46810ec72 ",
4810
4809
"author": {
4811
- "name": "baxterthehacker ",
4812
-
4813
- "username": "baxterthehacker "
4810
+ "name": "binkkatal ",
4811
+ "email": "binkkatal.r@gmail .com",
4812
+ "username": "binkkatal "
4814
4813
},
4815
4814
"committer": {
4816
- "name": "baxterthehacker ",
4817
-
4818
- "username": "baxterthehacker "
4815
+ "name": "binkkatal ",
4816
+ "email": "binkkatal.r@gmail .com",
4817
+ "username": "binkkatal "
4819
4818
},
4820
4819
"added": [
4821
-
4820
+ ".razorops.yaml"
4822
4821
],
4823
4822
"removed": [
4824
4823
4825
4824
],
4826
4825
"modified": [
4827
- "README.md "
4826
+ "app/controllers/application_controller.rb "
4828
4827
]
4829
4828
},
4830
4829
"repository": {
4831
- "id": 35129377,
4832
- "name": "public-repo",
4833
- "full_name": "baxterthehacker/public-repo",
4830
+ "id": 63933911,
4831
+ "node_id": "MDEwOlJlcG9zaXRvcnk2MzkzMzkxMQ==",
4832
+ "name": "sample_app",
4833
+ "full_name": "binkkatal/sample_app",
4834
4834
"owner": {
4835
- "name": "baxterthehacker",
4836
-
4835
+ "name": "binkkatal",
4836
+
4837
+ "login": "binkkatal",
4838
+ "id": 13351472,
4839
+ "node_id": "MDQ6VXNlcjEzMzUxNDcy",
4840
+ "avatar_url": "https://avatars3.githubusercontent.com/u/13351472?v=4",
4841
+ "gravatar_id": "",
4842
+ "url": "https://api.github.com/users/binkkatal",
4843
+ "html_url": "https://github.com/binkkatal",
4844
+ "followers_url": "https://api.github.com/users/binkkatal/followers",
4845
+ "following_url": "https://api.github.com/users/binkkatal/following{/other_user}",
4846
+ "gists_url": "https://api.github.com/users/binkkatal/gists{/gist_id}",
4847
+ "starred_url": "https://api.github.com/users/binkkatal/starred{/owner}{/repo}",
4848
+ "subscriptions_url": "https://api.github.com/users/binkkatal/subscriptions",
4849
+ "organizations_url": "https://api.github.com/users/binkkatal/orgs",
4850
+ "repos_url": "https://api.github.com/users/binkkatal/repos",
4851
+ "events_url": "https://api.github.com/users/binkkatal/events{/privacy}",
4852
+ "received_events_url": "https://api.github.com/users/binkkatal/received_events",
4853
+ "type": "User",
4854
+ "site_admin": false
4837
4855
},
4838
4856
"private": false,
4839
- "html_url": "https://github.com/baxterthehacker/public-repo ",
4840
- "description": "" ,
4857
+ "html_url": "https://github.com/binkkatal/sample_app ",
4858
+ "description": null ,
4841
4859
"fork": false,
4842
- "url": "https://github.com/baxterthehacker/public-repo",
4843
- "forks_url": "https://api.github.com/repos/baxterthehacker/public-repo/forks",
4844
- "keys_url": "https://api.github.com/repos/baxterthehacker/public-repo/keys{/key_id}",
4845
- "collaborators_url": "https://api.github.com/repos/baxterthehacker/public-repo/collaborators{/collaborator}",
4846
- "teams_url": "https://api.github.com/repos/baxterthehacker/public-repo/teams",
4847
- "hooks_url": "https://api.github.com/repos/baxterthehacker/public-repo/hooks",
4848
- "issue_events_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/events{/number}",
4849
- "events_url": "https://api.github.com/repos/baxterthehacker/public-repo/events",
4850
- "assignees_url": "https://api.github.com/repos/baxterthehacker/public-repo/assignees{/user}",
4851
- "branches_url": "https://api.github.com/repos/baxterthehacker/public-repo/branches{/branch}",
4852
- "tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/tags",
4853
- "blobs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/blobs{/sha}",
4854
- "git_tags_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/tags{/sha}",
4855
- "git_refs_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/refs{/sha}",
4856
- "trees_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/trees{/sha}",
4857
- "statuses_url": "https://api.github.com/repos/baxterthehacker/public-repo/statuses/{sha}",
4858
- "languages_url": "https://api.github.com/repos/baxterthehacker/public-repo/languages",
4859
- "stargazers_url": "https://api.github.com/repos/baxterthehacker/public-repo/stargazers",
4860
- "contributors_url": "https://api.github.com/repos/baxterthehacker/public-repo/contributors",
4861
- "subscribers_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscribers",
4862
- "subscription_url": "https://api.github.com/repos/baxterthehacker/public-repo/subscription",
4863
- "commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/commits{/sha}",
4864
- "git_commits_url": "https://api.github.com/repos/baxterthehacker/public-repo/git/commits{/sha}",
4865
- "comments_url": "https://api.github.com/repos/baxterthehacker/public-repo/comments{/number}",
4866
- "issue_comment_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues/comments{/number}",
4867
- "contents_url": "https://api.github.com/repos/baxterthehacker/public-repo/contents/{+path}",
4868
- "compare_url": "https://api.github.com/repos/baxterthehacker/public-repo/compare/{base}...{head}",
4869
- "merges_url": "https://api.github.com/repos/baxterthehacker/public-repo/merges",
4870
- "archive_url": "https://api.github.com/repos/baxterthehacker/public-repo/{archive_format}{/ref}",
4871
- "downloads_url": "https://api.github.com/repos/baxterthehacker/public-repo/downloads",
4872
- "issues_url": "https://api.github.com/repos/baxterthehacker/public-repo/issues{/number}",
4873
- "pulls_url": "https://api.github.com/repos/baxterthehacker/public-repo/pulls{/number}",
4874
- "milestones_url": "https://api.github.com/repos/baxterthehacker/public-repo/milestones{/number}",
4875
- "notifications_url": "https://api.github.com/repos/baxterthehacker/public-repo/notifications{?since,all,participating}",
4876
- "labels_url": "https://api.github.com/repos/baxterthehacker/public-repo/labels{/name}",
4877
- "releases_url": "https://api.github.com/repos/baxterthehacker/public-repo/releases{/id}",
4878
- "created_at": 1430869212,
4879
- "updated_at": "2015-05-05T23:40:12Z",
4880
- "pushed_at": 1430869217,
4881
- "git_url": "git://github.com/baxterthehacker/public-repo.git",
4882
- "ssh_url": "[email protected] :baxterthehacker/public-repo.git",
4883
- "clone_url": "https://github.com/baxterthehacker/public-repo.git",
4884
- "svn_url": "https://github.com/baxterthehacker/public-repo",
4860
+ "url": "https://github.com/binkkatal/sample_app",
4861
+ "forks_url": "https://api.github.com/repos/binkkatal/sample_app/forks",
4862
+ "keys_url": "https://api.github.com/repos/binkkatal/sample_app/keys{/key_id}",
4863
+ "collaborators_url": "https://api.github.com/repos/binkkatal/sample_app/collaborators{/collaborator}",
4864
+ "teams_url": "https://api.github.com/repos/binkkatal/sample_app/teams",
4865
+ "hooks_url": "https://api.github.com/repos/binkkatal/sample_app/hooks",
4866
+ "issue_events_url": "https://api.github.com/repos/binkkatal/sample_app/issues/events{/number}",
4867
+ "events_url": "https://api.github.com/repos/binkkatal/sample_app/events",
4868
+ "assignees_url": "https://api.github.com/repos/binkkatal/sample_app/assignees{/user}",
4869
+ "branches_url": "https://api.github.com/repos/binkkatal/sample_app/branches{/branch}",
4870
+ "tags_url": "https://api.github.com/repos/binkkatal/sample_app/tags",
4871
+ "blobs_url": "https://api.github.com/repos/binkkatal/sample_app/git/blobs{/sha}",
4872
+ "git_tags_url": "https://api.github.com/repos/binkkatal/sample_app/git/tags{/sha}",
4873
+ "git_refs_url": "https://api.github.com/repos/binkkatal/sample_app/git/refs{/sha}",
4874
+ "trees_url": "https://api.github.com/repos/binkkatal/sample_app/git/trees{/sha}",
4875
+ "statuses_url": "https://api.github.com/repos/binkkatal/sample_app/statuses/{sha}",
4876
+ "languages_url": "https://api.github.com/repos/binkkatal/sample_app/languages",
4877
+ "stargazers_url": "https://api.github.com/repos/binkkatal/sample_app/stargazers",
4878
+ "contributors_url": "https://api.github.com/repos/binkkatal/sample_app/contributors",
4879
+ "subscribers_url": "https://api.github.com/repos/binkkatal/sample_app/subscribers",
4880
+ "subscription_url": "https://api.github.com/repos/binkkatal/sample_app/subscription",
4881
+ "commits_url": "https://api.github.com/repos/binkkatal/sample_app/commits{/sha}",
4882
+ "git_commits_url": "https://api.github.com/repos/binkkatal/sample_app/git/commits{/sha}",
4883
+ "comments_url": "https://api.github.com/repos/binkkatal/sample_app/comments{/number}",
4884
+ "issue_comment_url": "https://api.github.com/repos/binkkatal/sample_app/issues/comments{/number}",
4885
+ "contents_url": "https://api.github.com/repos/binkkatal/sample_app/contents/{+path}",
4886
+ "compare_url": "https://api.github.com/repos/binkkatal/sample_app/compare/{base}...{head}",
4887
+ "merges_url": "https://api.github.com/repos/binkkatal/sample_app/merges",
4888
+ "archive_url": "https://api.github.com/repos/binkkatal/sample_app/{archive_format}{/ref}",
4889
+ "downloads_url": "https://api.github.com/repos/binkkatal/sample_app/downloads",
4890
+ "issues_url": "https://api.github.com/repos/binkkatal/sample_app/issues{/number}",
4891
+ "pulls_url": "https://api.github.com/repos/binkkatal/sample_app/pulls{/number}",
4892
+ "milestones_url": "https://api.github.com/repos/binkkatal/sample_app/milestones{/number}",
4893
+ "notifications_url": "https://api.github.com/repos/binkkatal/sample_app/notifications{?since,all,participating}",
4894
+ "labels_url": "https://api.github.com/repos/binkkatal/sample_app/labels{/name}",
4895
+ "releases_url": "https://api.github.com/repos/binkkatal/sample_app/releases{/id}",
4896
+ "deployments_url": "https://api.github.com/repos/binkkatal/sample_app/deployments",
4897
+ "created_at": 1469173225,
4898
+ "updated_at": "2016-07-22T07:48:39Z",
4899
+ "pushed_at": 1530281075,
4900
+ "git_url": "git://github.com/binkkatal/sample_app.git",
4901
+ "ssh_url": "[email protected] :binkkatal/sample_app.git",
4902
+ "clone_url": "https://github.com/binkkatal/sample_app.git",
4903
+ "svn_url": "https://github.com/binkkatal/sample_app",
4885
4904
"homepage": null,
4886
- "size": 0 ,
4905
+ "size": 23 ,
4887
4906
"stargazers_count": 0,
4888
4907
"watchers_count": 0,
4889
- "language": null ,
4908
+ "language": "Ruby" ,
4890
4909
"has_issues": true,
4910
+ "has_projects": true,
4891
4911
"has_downloads": true,
4892
4912
"has_wiki": true,
4893
- "has_pages": true ,
4913
+ "has_pages": false ,
4894
4914
"forks_count": 0,
4895
4915
"mirror_url": null,
4916
+ "archived": false,
4896
4917
"open_issues_count": 0,
4918
+ "license": null,
4897
4919
"forks": 0,
4898
4920
"open_issues": 0,
4899
4921
"watchers": 0,
@@ -4902,35 +4924,35 @@ func TestPushEvent(t *testing.T) {
4902
4924
"master_branch": "master"
4903
4925
},
4904
4926
"pusher": {
4905
- "name": "baxterthehacker ",
4906
-
4927
+ "name": "binkkatal ",
4928
+ "email": "binkkatal.r@gmail .com"
4907
4929
},
4908
4930
"sender": {
4909
- "login": "baxterthehacker",
4910
- "id": 6752317,
4911
- "avatar_url": "https://avatars.githubusercontent.com/u/6752317?v=3",
4931
+ "login": "binkkatal",
4932
+ "id": 13351472,
4933
+ "node_id": "MDQ6VXNlcjEzMzUxNDcy",
4934
+ "avatar_url": "https://avatars3.githubusercontent.com/u/13351472?v=4",
4912
4935
"gravatar_id": "",
4913
- "url": "https://api.github.com/users/baxterthehacker ",
4914
- "html_url": "https://github.com/baxterthehacker ",
4915
- "followers_url": "https://api.github.com/users/baxterthehacker /followers",
4916
- "following_url": "https://api.github.com/users/baxterthehacker /following{/other_user}",
4917
- "gists_url": "https://api.github.com/users/baxterthehacker /gists{/gist_id}",
4918
- "starred_url": "https://api.github.com/users/baxterthehacker /starred{/owner}{/repo}",
4919
- "subscriptions_url": "https://api.github.com/users/baxterthehacker /subscriptions",
4920
- "organizations_url": "https://api.github.com/users/baxterthehacker /orgs",
4921
- "repos_url": "https://api.github.com/users/baxterthehacker /repos",
4922
- "events_url": "https://api.github.com/users/baxterthehacker /events{/privacy}",
4923
- "received_events_url": "https://api.github.com/users/baxterthehacker /received_events",
4936
+ "url": "https://api.github.com/users/binkkatal ",
4937
+ "html_url": "https://github.com/binkkatal ",
4938
+ "followers_url": "https://api.github.com/users/binkkatal /followers",
4939
+ "following_url": "https://api.github.com/users/binkkatal /following{/other_user}",
4940
+ "gists_url": "https://api.github.com/users/binkkatal /gists{/gist_id}",
4941
+ "starred_url": "https://api.github.com/users/binkkatal /starred{/owner}{/repo}",
4942
+ "subscriptions_url": "https://api.github.com/users/binkkatal /subscriptions",
4943
+ "organizations_url": "https://api.github.com/users/binkkatal /orgs",
4944
+ "repos_url": "https://api.github.com/users/binkkatal /repos",
4945
+ "events_url": "https://api.github.com/users/binkkatal /events{/privacy}",
4946
+ "received_events_url": "https://api.github.com/users/binkkatal /received_events",
4924
4947
"type": "User",
4925
4948
"site_admin": false
4926
4949
}
4927
- }
4928
- `
4950
+ }`
4929
4951
4930
4952
req , err := http .NewRequest ("POST" , "http://127.0.0.1:3010/webhooks" , bytes .NewBuffer ([]byte (payload )))
4931
4953
req .Header .Set ("Content-Type" , "application/json" )
4932
4954
req .Header .Set ("X-Github-Event" , "push" )
4933
- req .Header .Set ("X-Hub-Signature" , "sha1=c7097badc10db8a2ec615e340534956e75a483c6 " )
4955
+ req .Header .Set ("X-Hub-Signature" , "sha1=0534736f52c2fc5896ef1bd5a043127b20d233ba " )
4934
4956
4935
4957
Equal (t , err , nil )
4936
4958
@@ -4941,6 +4963,7 @@ func TestPushEvent(t *testing.T) {
4941
4963
defer resp .Body .Close ()
4942
4964
4943
4965
Equal (t , resp .StatusCode , http .StatusOK )
4966
+
4944
4967
}
4945
4968
4946
4969
func TestReleaseEvent (t * testing.T ) {
0 commit comments