Move stub to before block on restart test

This commit is contained in:
Ana Rosas 2016-05-23 14:38:38 -05:00
parent 2b37d90ffb
commit 3c253bb88c
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,6 @@ class Travis::Api::App
post '/:id/restart' do
Metriks.meter("api.request.restart_build").mark
if Travis::Features.owner_active?(:enqueue_to_hub, current_user)
service = Travis::Enqueue::Services::EnqueueBuild.new(current_user, params[:id])
if !service.accept?

View File

@ -113,7 +113,6 @@ describe 'Builds' do
context 'when build passed' do
before do
Travis::Sidekiq::BuildCancellation.stubs(:perform_async)
build.matrix.each { |j| j.update_attribute(:state, 'passed') }
build.update_attribute(:state, 'passed')
end
@ -136,6 +135,8 @@ describe 'Builds' do
end
describe 'Restart from the Core' do
before { Travis::Sidekiq::BuildRestart.stubs(:perform_async) }
it 'restarts the build' do
Travis::Sidekiq::BuildRestart.expects(:perform_async).with(id: build.id.to_s, user_id: user.id)
response = post "/builds/#{build.id}/restart", {}, headers