From 26edaf644fb46a68e5291bb62245c06a55ea9a0d Mon Sep 17 00:00:00 2001
From: Josh Kalderimis <josh.kalderimis@gmail.com>
Date: Tue, 5 Nov 2013 01:05:21 +0100
Subject: [PATCH] remove deprecated artifacts endpoint

---
 lib/travis/api/app/endpoint/artifacts.rb | 16 ---------
 spec/unit/endpoint/artifacts_spec.rb     | 44 ------------------------
 2 files changed, 60 deletions(-)
 delete mode 100644 lib/travis/api/app/endpoint/artifacts.rb
 delete mode 100644 spec/unit/endpoint/artifacts_spec.rb

diff --git a/lib/travis/api/app/endpoint/artifacts.rb b/lib/travis/api/app/endpoint/artifacts.rb
deleted file mode 100644
index cd35a570..00000000
--- a/lib/travis/api/app/endpoint/artifacts.rb
+++ /dev/null
@@ -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
diff --git a/spec/unit/endpoint/artifacts_spec.rb b/spec/unit/endpoint/artifacts_spec.rb
deleted file mode 100644
index b701cff7..00000000
--- a/spec/unit/endpoint/artifacts_spec.rb
+++ /dev/null
@@ -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