specs, stay on page

This commit is contained in:
Johannes Hackel 2011-11-22 12:54:19 +01:00
parent eb65074360
commit 66acd7db14
2 changed files with 5 additions and 1 deletions

View file

@ -24,7 +24,7 @@ class PeopleController < ApplicationController
return return
elsif (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length == 1 elsif (params[:q][0] == 35 || params[:q][0] == '#') && params[:q].length == 1
flash[:error] = I18n.t('tags.show.none', :name => params[:q]) flash[:error] = I18n.t('tags.show.none', :name => params[:q])
redirect_to multi_path() redirect_to :back
end end
limit = params[:limit] ? params[:limit].to_i : 15 limit = params[:limit] ? params[:limit].to_i : 15

View file

@ -91,6 +91,10 @@ describe PeopleController do
get :index, :q => '#babi.es' get :index, :q => '#babi.es'
response.should redirect_to(tag_path('babies', :q => '#babi.es')) response.should redirect_to(tag_path('babies', :q => '#babi.es'))
end end
it 'stay on the page if you search for the empty hash' do
get :index, :q => '#'
response.should redirect_to(:back)
end end
describe '#tag_index' do describe '#tag_index' do