Post Receive Refactored. Service hooks also triggered now
This commit is contained in:
parent
95c23b2f97
commit
8500743464
3 changed files with 89 additions and 60 deletions
|
@ -27,16 +27,12 @@ describe PostReceive do
|
|||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false
|
||||
end
|
||||
|
||||
it "asks the project to execute web hooks" do
|
||||
it "asks the project to trigger all hooks" do
|
||||
Project.stub(find_by_path: project)
|
||||
project.should_receive(:execute_hooks).with('sha-old', 'sha-new', 'refs/heads/master', project.owner)
|
||||
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id)
|
||||
end
|
||||
|
||||
it "asks the project to observe push/create event data" do
|
||||
Project.stub(find_by_path: project)
|
||||
project.should_receive(:observe_push).with('sha-old', 'sha-new', 'refs/heads/master', project.owner)
|
||||
project.should_receive(:execute_hooks)
|
||||
project.should_receive(:execute_services)
|
||||
project.should_receive(:update_merge_requests)
|
||||
project.should_receive(:observe_push)
|
||||
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', key_id)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue