summaryrefslogtreecommitdiff
path: root/spec/workers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-02-29 23:04:09 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-02-29 23:04:09 +0200
commit25bde28d13cdffda8efa4ecae00985085e6aa565 (patch)
tree61c676f45e05b4b2e3a7dd6b0b3196486d481f32 /spec/workers
parentbb164ebf1bd672527a76a6699427cbec728d638b (diff)
downloadgitlab-ce-25bde28d13cdffda8efa4ecae00985085e6aa565.tar.gz
Fixed tests. removed delegate to id
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/post_receive_spec.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index 500a69982c7..c28273d5e81 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -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