Commit 9ed59ee9f00ec31564f4f1f069f1cdcc7d78281b

Authored by Marin Jankovski
1 parent 1073019d

Include project_id in webhook payload.

app/services/git_push_service.rb
... ... @@ -112,6 +112,7 @@ class GitPushService
112 112 # ref: String,
113 113 # user_id: String,
114 114 # user_name: String,
  115 + # project_id: String,
115 116 # repository: {
116 117 # name: String,
117 118 # url: String,
... ... @@ -136,6 +137,7 @@ class GitPushService
136 137 ref: ref,
137 138 user_id: user.id,
138 139 user_name: user.name,
  140 + project_id: project.id,
139 141 repository: {
140 142 name: project.name,
141 143 url: project.url_to_repo,
... ...
app/views/projects/hooks/_data_ex.html.erb
... ... @@ -5,6 +5,7 @@
5 5 "ref": "refs/heads/master",
6 6 "user_id": 4,
7 7 "user_name": "John Smith",
  8 + "project_id": 15,
8 9 "repository": {
9 10 "name": "Diaspora",
10 11 "url": "git@localhost:diaspora.git",
... ...
spec/services/git_push_service_spec.rb
... ... @@ -26,6 +26,7 @@ describe GitPushService do
26 26 it { should include(ref: @ref) }
27 27 it { should include(user_id: user.id) }
28 28 it { should include(user_name: user.name) }
  29 + it { should include(project_id: project.id) }
29 30  
30 31 context "with repository data" do
31 32 subject { @push_data[:repository] }
... ...