update response status ans specs

This commit is contained in:
carlad 2015-01-27 13:31:12 +01:00
parent d050ebc018
commit f39d931857
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)