diff --git a/lib/travis/api/app/endpoint/jobs.rb b/lib/travis/api/app/endpoint/jobs.rb index d856093c..9bb2fbc9 100644 --- a/lib/travis/api/app/endpoint/jobs.rb +++ b/lib/travis/api/app/endpoint/jobs.rb @@ -62,7 +62,7 @@ class Travis::Api::App result = false else Travis::Sidekiq::JobRestart.perform_async(id: params[:id], user_id: current_user.id) - status 200 + status 202 result = true end respond_with(result: result, flash: service.messages) diff --git a/spec/integration/v2/builds_spec.rb b/spec/integration/v2/builds_spec.rb index b1c20506..e36aeeb2 100644 --- a/spec/integration/v2/builds_spec.rb +++ b/spec/integration/v2/builds_spec.rb @@ -121,7 +121,7 @@ describe 'Builds' do 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 - response.status.should == 200 + response.status.should == 202 end it 'sends the correct response body' do diff --git a/spec/integration/v2/jobs_spec.rb b/spec/integration/v2/jobs_spec.rb index 372a5245..51afa156 100644 --- a/spec/integration/v2/jobs_spec.rb +++ b/spec/integration/v2/jobs_spec.rb @@ -159,9 +159,9 @@ describe 'Jobs' do user.permissions.create!(repository_id: finished_job.repository.id, :push => true) end - it 'returns status 200' do + it 'returns status 202' do response = patch "/jobs/#{finished_job.id}/log", { reason: 'Because reason!' }, headers - response.status.should == 200 + response.status.should == 202 end end @@ -285,7 +285,7 @@ describe 'Jobs' do it 'restarts the job' do Travis::Sidekiq::JobRestart.expects(:perform_async).with(id: job.id.to_s, user_id: user.id) response = post "/jobs/#{job.id}/restart", {}, headers - response.status.should == 200 + response.status.should == 202 end it 'sends the correct response body' do Travis::Sidekiq::JobRestart.expects(:perform_async).with(id: job.id.to_s, user_id: user.id)