Fixed tests. removed delegate to id
This commit is contained in:
parent
bb164ebf1b
commit
25bde28d13
6 changed files with 27 additions and 13 deletions
|
@ -10,17 +10,22 @@ describe PostReceive do
|
|||
|
||||
context "web hooks" do
|
||||
let(:project) { Factory :project }
|
||||
before do
|
||||
@key = Factory :key, :user => project.owner
|
||||
@key_id = @key.identifier
|
||||
end
|
||||
|
||||
it "it retrieves the correct project" do
|
||||
Project.should_receive(:find_by_path).with(project.path)
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master')
|
||||
Key.should_receive(:find_by_identifier).with(project.path)
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', @key_id)
|
||||
end
|
||||
|
||||
it "asks the project to execute web hooks" do
|
||||
Project.stub(find_by_path: project)
|
||||
project.should_receive(:execute_web_hooks).with('sha-old', 'sha-new', 'refs/heads/master')
|
||||
project.should_receive(:execute_web_hooks).with('sha-old', 'sha-new', 'refs/heads/master', @key_id)
|
||||
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master')
|
||||
PostReceive.perform(project.path, 'sha-old', 'sha-new', 'refs/heads/master', @key_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue