require'spec_helper'describeBuildHooksWorkerdodescribe'#perform'docontext'when build exists'dolet!(:build){create(:ci_build)}it'calls build hooks'doexpect_any_instance_of(Ci::Build).toreceive(:execute_hooks)described_class.new.perform(build.id)endendcontext'when build does not exist'doit'does not raise exception'doexpect{described_class.new.perform(123)}.not_toraise_errorendendendend