Added specs for special cases
We don't execute web hooks when: * You create a new branch. Make sure you first create the branch, and then push any commits. This is the way Github works, so its expected behavior. * When tags are pushed.
This commit is contained in:
parent
edab46e9fa
commit
7ffb8fc616
2 changed files with 27 additions and 1 deletions
|
@ -91,10 +91,31 @@ describe Project do
|
|||
@webhook.should_receive(:execute).once
|
||||
@webhook_2.should_receive(:execute).once
|
||||
|
||||
project.execute_web_hooks('oldrev', 'newrev', 'ref')
|
||||
project.execute_web_hooks('oldrev', 'newrev', 'refs/heads/master')
|
||||
end
|
||||
end
|
||||
|
||||
context "does not execute web hooks" do
|
||||
before do
|
||||
@webhook = Factory(:web_hook)
|
||||
project.web_hooks << [@webhook]
|
||||
end
|
||||
|
||||
it "when pushing a branch for the first time" do
|
||||
@webhook.should_not_receive(:execute)
|
||||
project.execute_web_hooks('00000000000000000000000000000000', 'newrev', 'refs/heads/mster')
|
||||
end
|
||||
|
||||
it "when pushing tags" do
|
||||
@webhook.should_not_receive(:execute)
|
||||
project.execute_web_hooks('oldrev', 'newrev', 'refs/tags/v1.0.0')
|
||||
end
|
||||
end
|
||||
|
||||
context "when pushing new branches" do
|
||||
|
||||
end
|
||||
|
||||
context "when gathering commit data" do
|
||||
before do
|
||||
@oldrev, @newrev, @ref = project.fresh_commits(2).last.sha, project.fresh_commits(2).first.sha, 'refs/heads/master'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue