Commit fc65f717 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix post-receive specs

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 730712f7
require 'spec_helper' require 'spec_helper'
describe PostReceive do describe PostReceive do
context "as a resque worker" do context "as a resque worker" do
it "reponds to #perform" do it "reponds to #perform" do
PostReceive.new.should respond_to(:perform) PostReceive.new.should respond_to(:perform)
...@@ -15,7 +14,7 @@ describe PostReceive do ...@@ -15,7 +14,7 @@ describe PostReceive do
it "fetches the correct project" do it "fetches the correct project" do
Project.should_receive(:find_with_namespace).with(project.path_with_namespace).and_return(project) Project.should_receive(:find_with_namespace).with(project.path_with_namespace).and_return(project)
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id) PostReceive.new.perform(pwd(project), key_id, changes)
end end
it "does not run if the author is not in the project" do it "does not run if the author is not in the project" do
...@@ -23,7 +22,7 @@ describe PostReceive do ...@@ -23,7 +22,7 @@ describe PostReceive do
project.should_not_receive(:execute_hooks) project.should_not_receive(:execute_hooks)
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false PostReceive.new.perform(pwd(project), key_id, changes).should be_false
end end
it "asks the project to trigger all hooks" do it "asks the project to trigger all hooks" do
...@@ -32,11 +31,15 @@ describe PostReceive do ...@@ -32,11 +31,15 @@ describe PostReceive do
project.should_receive(:execute_services) project.should_receive(:execute_services)
project.should_receive(:update_merge_requests) project.should_receive(:update_merge_requests)
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id) PostReceive.new.perform(pwd(project), key_id, changes)
end end
end end
def pwd(project) def pwd(project)
File.join(Gitlab.config.gitlab_shell.repos_path, project.path_with_namespace) File.join(Gitlab.config.gitlab_shell.repos_path, project.path_with_namespace)
end end
def changes
'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master'
end
end end
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