remove deprecated artifacts endpoint
This commit is contained in:
parent
53923dad20
commit
26edaf644f
|
@ -1,16 +0,0 @@
|
|||
require 'travis/api/app'
|
||||
|
||||
class Travis::Api::App
|
||||
class Endpoint
|
||||
# Artifacts are generated by builds. Currently we only expose logs as
|
||||
# artifacts
|
||||
#
|
||||
# **DEPRECATED** will be removed as soon as the client uses /logs/:id
|
||||
class Artifacts < Endpoint
|
||||
# Fetches an artifact by it's *id*.
|
||||
get '/:id' do |id|
|
||||
respond_with service(:find_log, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,44 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Travis::Api::App::Endpoint::Artifacts do
|
||||
let(:artifact) { Factory(:log) }
|
||||
let(:id) { artifact.id }
|
||||
|
||||
describe 'GET /artifacts/:id' do
|
||||
it 'loads the artifact' do
|
||||
get("/artifacts/#{id}", {}, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01').should be_ok
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /artifacts/:id.txt' do
|
||||
it 'loads the artifact' do
|
||||
response = get("/artifacts/#{id}.txt", {})
|
||||
|
||||
response.should be_ok
|
||||
response.body.should == artifact.content
|
||||
response.headers['Content-Disposition'].should == "inline; filename=\"#{artifact.id}\""
|
||||
end
|
||||
|
||||
it 'sets Content-Disposition to attachment with attachment=true param' do
|
||||
response = get("/artifacts/#{id}.txt", {'attachment' => true})
|
||||
|
||||
response.should be_ok
|
||||
response.body.should == artifact.content
|
||||
response.headers['Content-Disposition'].should == "attachment; filename=\"#{artifact.id}\""
|
||||
end
|
||||
|
||||
describe 'with deansi param' do
|
||||
let(:content) {
|
||||
"Fetching (0%)\rFetching (10%)\rFetching (100%)\n\e[32m"
|
||||
}
|
||||
let(:artifact) { Factory(:log, :content => content) }
|
||||
|
||||
it 'clears ansi escape control characters' do
|
||||
response = get("/artifacts/#{id}.txt", {'deansi' => true})
|
||||
|
||||
response.should be_ok
|
||||
response.body.should == "Fetching (100%)\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user