require'spec_helper'describePostReceivedocontext"as a resque worker"doit"reponds to #perform"doPostReceive.shouldrespond_to(:perform)endendcontext"web hooks"dolet(:project){Factory:project}it"it retrieves the correct project"doProject.should_receive(:find_by_path).with(project.path)PostReceive.perform(project.path,'sha-old','sha-new','refs/heads/master')endit"asks the project to execute web hooks"doProject.stub(find_by_path: project)project.should_receive(:execute_web_hooks).with('sha-old','sha-new','refs/heads/master')PostReceive.perform(project.path,'sha-old','sha-new','refs/heads/master')endendend