sidekiq with green tests

This commit is contained in:
Dmitriy Zaporozhets 2013-01-09 09:14:05 +03:00
parent 71bd956866
commit 9773ccc451
14 changed files with 48 additions and 68 deletions

View file

@ -4,7 +4,7 @@ describe PostReceive do
context "as a resque worker" do
it "reponds to #perform" do
PostReceive.should respond_to(:perform)
PostReceive.new.should respond_to(:perform)
end
end
@ -15,7 +15,7 @@ describe PostReceive do
it "fetches the correct project" do
Project.should_receive(:find_with_namespace).with(project.path_with_namespace).and_return(project)
PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
end
it "does not run if the author is not in the project" do
@ -24,7 +24,7 @@ describe PostReceive do
project.should_not_receive(:observe_push)
project.should_not_receive(:execute_hooks)
PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false
end
it "asks the project to trigger all hooks" do
@ -34,7 +34,7 @@ describe PostReceive do
project.should_receive(:update_merge_requests)
project.should_receive(:observe_push)
PostReceive.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
end
end