Commit e0add7de authored by Valery Sizov's avatar Valery Sizov

Merge branch 'web_hook_fix' into 'master'

Fix group web_hooks

https://dev.gitlab.org/gitlab/gitlabhq/issues/2452

See merge request !438
parents 13ed1226 2d1d6fc0
v7.13.1
v 7.13.2
- Fix group web hook
v 7.13.1
- Merge community edition changes for version 7.13.1
- Fix: "Rebase before merge" doesn't work when source branch is in the same project
......
......@@ -512,7 +512,7 @@ class Project < ActiveRecord::Base
end
if group
group.hooks.send(hooks_scope).each do |hook|
hook.async_execute(data)
hook.async_execute(data, hooks_scope.to_s)
end
end
end
......
......@@ -365,6 +365,23 @@ describe Project do
end
end
describe :execute_hooks do
it "triggers project and group hooks" do
group = create :group, name: 'gitlab'
project = create(:project, name: 'gitlabhq', namespace: group)
project_hook = create(:project_hook, push_events: true, project: project)
group_hook = create(:group_hook, push_events: true, group: group)
stub_request(:post, project_hook.url)
stub_request(:post, group_hook.url)
expect_any_instance_of(ProjectHook).to receive(:async_execute).and_return(true)
expect_any_instance_of(GroupHook).to receive(:async_execute).and_return(true)
project.execute_hooks({}, :push_hooks)
end
end
describe :avatar_url do
subject { project.avatar_url }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment