Skip to content

Commit

Permalink
Move stub to before block on restart test
Browse files Browse the repository at this point in the history
  • Loading branch information
anarosas committed May 23, 2016
1 parent 2b37d90 commit 3c253bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/travis/api/app/endpoint/builds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class Builds < Endpoint

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?
Expand Down
3 changes: 2 additions & 1 deletion spec/integration/v2/builds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@

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
Expand All @@ -136,6 +135,8 @@
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
Expand Down

0 comments on commit 3c253bb

Please sign in to comment.