Merge branch 'master' into ha-feature-remove_log_endpoint
This commit is contained in:
commit
dae8652279
|
@ -19,3 +19,4 @@ notifications:
|
|||
irc: "irc.freenode.org#travis"
|
||||
services:
|
||||
- redis
|
||||
cache: bundler
|
||||
|
|
16
lib/travis/api/app/endpoint/branches.rb
Normal file
16
lib/travis/api/app/endpoint/branches.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
class Endpoint
|
||||
class Branches < Endpoint
|
||||
get '/' do
|
||||
respond_with service(:find_branches, params), type: :branches
|
||||
end
|
||||
|
||||
# get '/:owner_name/:name/branches' do # v1
|
||||
# get '/repos/:owner_name/:name/branches' do # v2
|
||||
# respond_with service(:branches, :find_all, params), type: :branches
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
11
spec/integration/v1/branches_spec.rb
Normal file
11
spec/integration/v1/branches_spec.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'Branches' do
|
||||
let(:repo) { Repository.by_slug('svenfuchs/minimal').first }
|
||||
let(:headers) { { 'HTTP_ACCEPT' => 'application/vnd.travis-ci.1+json' } }
|
||||
|
||||
it 'GET /branches?repository_id=:repository_id' do
|
||||
response = get '/branches', { repository_id: repo.id }, headers
|
||||
response.should deliver_json_for(repo.last_finished_builds_by_branches, version: 'v1', type: 'branches')
|
||||
end
|
||||
end
|
11
spec/integration/v2/branches_spec.rb
Normal file
11
spec/integration/v2/branches_spec.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'Branches' do
|
||||
let(:repo) { Repository.by_slug('svenfuchs/minimal').first }
|
||||
let(:headers) { { 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json' } }
|
||||
|
||||
it 'GET /branches?repository_id=:repository_id' do
|
||||
response = get '/branches', { repository_id: repo.id }, headers
|
||||
response.should deliver_json_for(repo.last_finished_builds_by_branches, version: 'v2', type: 'branches')
|
||||
end
|
||||
end
|
5
spec/unit/endpoint/branches_spec.rb
Normal file
5
spec/unit/endpoint/branches_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Travis::Api::App::Endpoint::Branches do
|
||||
it 'has to be tested'
|
||||
end
|
Loading…
Reference in New Issue
Block a user