Skip to content

Commit

Permalink
Merge pull request #175 from travis-ci/remove-triggering-builds-in-v2
Browse files Browse the repository at this point in the history
Remove triggering builds in V2
  • Loading branch information
drogus committed Jun 29, 2015
2 parents 02fce16 + 66f5d71 commit a1b421a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 84 deletions.
2 changes: 1 addition & 1 deletion lib/travis/api/app/endpoint/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Requests < Endpoint

post '/', scope: :private do
if params[:request] && params[:request][:repository]
respond_with service(:schedule_request, params[:request])
status 404
else
# DEPRECATED: this will be removed by 1st of December
Metriks.meter("api.request.restart").mark
Expand Down
27 changes: 0 additions & 27 deletions spec/integration/v2/requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,4 @@
response.should deliver_json_for(request, version: 'v2', type: 'request')
end
end

describe 'POST /requests' do
let(:payload) { { request: { repository: { owner_name: repo.owner_name, name: repo.name } } } }

before do
Travis::Features.stubs(:owner_active?).returns(true)
end

it 'schedules a request' do
response = post '/requests', payload, headers
expect(response.status).to eq 200
end

it 'requires activation' do
Travis::Features.stubs(:owner_active?).returns(false)
response = post '/requests', payload, headers
json = JSON.parse(response.body)
expect(json['result']).to eq 'not_active'
end

it 'throttles requests' do
Travis::Api::App::Services::ScheduleRequest::Throttle.any_instance.stubs(:throttled?).returns(true)
response = post '/requests', payload, headers
json = JSON.parse(response.body)
expect(json['result']).to eq 'throttled'
end
end
end
56 changes: 0 additions & 56 deletions spec/unit/endpoint/requests_spec.rb

This file was deleted.

0 comments on commit a1b421a

Please sign in to comment.