Merge pull request #90 from travis-ci/jk_remove_artifacts_endpoint

Remove deprecated artifacts endpoint
This commit is contained in:
Konstantin Haase 2013-11-05 04:23:04 -08:00
commit 6f92f122b0
2 changed files with 0 additions and 60 deletions

View File

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

View File

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