From ff58d631919211f38c08f963393c96566deb284b Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sat, 30 Apr 2011 16:28:39 +0200 Subject: [PATCH] minor cleanup to routes.rb --- app/controllers/people_controller.rb | 2 +- config/routes.rb | 24 +++++++++++----------- spec/controllers/people_controller_spec.rb | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 33a5fe971..403b5b04e 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -125,7 +125,7 @@ class PeopleController < ApplicationController end def contacts - @person = Person.find(params[:id]) + @person = Person.find(params[:person_id]) if @person @contact = current_user.contact_for(@person) @aspect = :profile diff --git a/config/routes.rb b/config/routes.rb index fc047c5e3..55ff7b626 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,19 +12,16 @@ Diaspora::Application.routes.draw do end resources :status_messages, :only => [:new, :create, :destroy, :show] - get 'p/:id' => 'posts#show', :as => 'post' get 'bookmarklet' => 'status_messages#bookmarklet' + get 'p/:id' => 'posts#show', :as => 'post' resources :photos, :except => [:index] do put 'make_profile_photo' => :make_profile_photo end resources :comments, :only => [:create, :destroy] + resource :like, :only => [:create] - get 'tags/:name' => 'tags#show', :as => 'tag' - resources :tags, :only => [:index] - - resource :like, :only => [:create] resources :conversations do resources :messages, :only => [:create, :show] @@ -35,6 +32,8 @@ Diaspora::Application.routes.draw do get 'read_all' => :read_all, :on => :collection end + resources :tags, :only => [:index] + get 'tags/:name' => 'tags#show', :as => 'tag' # Users and people @@ -42,7 +41,7 @@ Diaspora::Application.routes.draw do get :export get :export_photos end - match '/people/:id/contacts' => 'people#contacts' + controller :users do get 'public/:username' => :public, :as => 'users_public' @@ -63,22 +62,23 @@ Diaspora::Application.routes.draw do get 'login' => redirect('/users/sign_in') scope 'admins', :controller => :admins do - match 'user_search' => :user_search - get 'admin_inviter' => :admin_inviter - get 'add_invites' => :add_invites, :as => 'add_invites' + match 'user_search' => :user_search + get 'admin_inviter' => :admin_inviter + get 'add_invites' => :add_invites, :as => 'add_invites' end resource :profile resources :requests, :only => [:destroy, :create] - resources :contacts, :except => [:index, :update] - resources :aspect_memberships, :only => [:destroy, :create, :update] - resources :post_visibilities, :only => [:update] + resources :contacts, :except => [:index, :update] + resources :aspect_memberships, :only => [:destroy, :create, :update] + resources :post_visibilities, :only => [:update] resources :people, :except => [:edit, :update] do resources :status_messages resources :photos + get :contacts post 'by_handle' => :retrieve_remote, :on => :collection, :as => 'person_by_handle' end diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index e38239a3b..046094236 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -253,7 +253,7 @@ describe PeopleController do it 'assigns the contacts of a person' do contact = alice.contact_for(bob.person) contacts = contact.contacts - get :contacts, :id => bob.person.id + get :contacts, :person_id => bob.person.id assigns(:contacts_of_contact).should == contacts end end