From dce54f3d403c2f713477d36cd68119c0e61c6197 Mon Sep 17 00:00:00 2001 From: MrZYX Date: Sat, 19 Mar 2011 14:46:04 +0100 Subject: [PATCH] fixed #947 --- app/controllers/people_controller.rb | 4 ++-- spec/controllers/people_controller_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 1364d3971..1ee4d787b 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -12,8 +12,8 @@ class PeopleController < ApplicationController @aspect = :search params[:q] ||= params[:term] - if params[:q][0] == 35 || params[:q][0] == '#' - redirect_to "/p/?tag=#{params[:q].gsub("#", "")}" + if (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length > 1 + redirect_to "/tags/#{params[:q].gsub("#", "")}" return end diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index b279ce536..e20ada745 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -53,7 +53,7 @@ describe PeopleController do it 'goes to a tag page if you search for a hash' do get :index, :q => '#babies' - response.should redirect_to('/p/?tag=babies') + response.should redirect_to('/tags/babies') end end