Add GET /jobs/:job_id/metadata endpoint
This commit is contained in:
parent
5236e6d4e7
commit
b103a7ccb1
|
@ -28,6 +28,10 @@ class Travis::Api::App
|
|||
end
|
||||
end
|
||||
|
||||
get "/:job_id/metadata" do
|
||||
respond_with service(:find_metadata, params)
|
||||
end
|
||||
|
||||
def archive_url(path)
|
||||
"https://s3.amazonaws.com/#{hostname('archive')}#{path}"
|
||||
end
|
||||
|
|
|
@ -75,4 +75,11 @@ describe 'Jobs' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it "/jobs/:id/metadata" do
|
||||
metadata_provider = Factory(:metadata_provider)
|
||||
metadata = metadata_provider.metadata.create(job_id: job.id, description: "Foobar")
|
||||
response = get "/jobs/#{job.id}/metadata", {}, headers
|
||||
response.should deliver_json_for(Metadata.where(id: metadata.id), version: 'v2')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Travis::Api::App::Endpoint::Jobs do
|
||||
it 'has to be tested'
|
||||
let(:job) { Factory(:test) }
|
||||
|
||||
it "GET /jobs/:id/metadata" do
|
||||
get("/jobs/#{job.id}/metadata", {}, "HTTP_ACCEPT" => "application/vnd.travis-ci.2+json, */*; q=0.01").should be_ok
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user