diff --git a/app/controllers/api/v0/tags_controller.rb b/app/controllers/api/v0/tags_controller.rb deleted file mode 100644 index 1ce401b1c22f5343ddf1a838366314f4e6dbeb4b..0000000000000000000000000000000000000000 --- a/app/controllers/api/v0/tags_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -class Api::V0::TagsController < ApplicationController - def show - render :json => Api::V0::Serializers::Tag.new(params[:name]) - end -end diff --git a/app/controllers/api/v0/users_controller.rb b/app/controllers/api/v0/users_controller.rb deleted file mode 100644 index 5328a63c3f2b5230f78e0e771c9c3c032b44e81e..0000000000000000000000000000000000000000 --- a/app/controllers/api/v0/users_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -class Api::V0::UsersController < ApplicationController - def show - if user = User.find_by_username(params[:username]) - render :json => Api::V0::Serializers::User.new(user) - else - head :not_found - end - end -end diff --git a/app/models/api/v0/serializers/tag.rb b/app/models/api/v0/serializers/tag.rb deleted file mode 100644 index bd378607d677f0a90a49aa8b8b8bb3fe1a216ac7..0000000000000000000000000000000000000000 --- a/app/models/api/v0/serializers/tag.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -class Api::V0::Serializers::Tag - - def initialize(tag) - @stream = Stream::Tag.new(nil, tag) - end - - def as_json(opts={}) - { - "name" => @stream.tag_name, - "person_count" => @stream.tagged_people_count, - "followed_count" => @stream.tag_follow_count, - "posts" => [] - } - end -end diff --git a/app/models/api/v0/serializers/user.rb b/app/models/api/v0/serializers/user.rb deleted file mode 100644 index 2dc94fc0724ea4265426bb5e3b3bff864359db24..0000000000000000000000000000000000000000 --- a/app/models/api/v0/serializers/user.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -class Api::V0::Serializers::User - def initialize(user) - @person = user.person - @profile = @person.profile - end - - def as_json(opts={}) - { - "diaspora_id" => @person.diaspora_handle, - "first_name" => @profile.first_name, - "last_name" => @profile.last_name, - "image_url" => @profile.image_url, - "searchable" => @profile.searchable - } - end -end diff --git a/spec/controllers/api/v0/tags_controller_spec.rb b/spec/controllers/api/v0/tags_controller_spec.rb deleted file mode 100644 index 1fd9867a4fbdd9e9136b7fea527410a23fa51c10..0000000000000000000000000000000000000000 --- a/spec/controllers/api/v0/tags_controller_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe Api::V0::TagsController do - describe '#show' do - it 'succeeds' do - get :show, :name => 'alice' - response.should be_success - end - - it "returns the basic tag data" do - get :show, :name => 'alice' - parsed_json = JSON.parse(response.body) - parsed_json.keys.should =~ %w(name person_count followed_count posts) - end - end -end diff --git a/spec/controllers/api/v0/users_controller_spec.rb b/spec/controllers/api/v0/users_controller_spec.rb deleted file mode 100644 index 1fc3e8e7b13b5aec8c5405d8c23c20d92d27e030..0000000000000000000000000000000000000000 --- a/spec/controllers/api/v0/users_controller_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe Api::V0::UsersController do - describe '#show' do - it 'succeeds' do - get :show, :username => 'alice' - response.should be_success - end - it "404s if there's no such user" do - get :show, :username => "*****" - response.should be_not_found - end - it "returns the public profile data" do - get :show, :username => 'alice' - parsed_json = JSON.parse(response.body) - parsed_json.keys.should =~ %w( diaspora_id first_name last_name image_url searchable ) - end - end -end