From 82bfcffc3e0ca2c8368c245755a677d8e68759ed Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Thu, 26 Jun 2008 20:10:31 +0000 Subject: [PATCH] ActionItem495: fixed --- app/views/search/_directory.rhtml | 4 ++-- test/functional/search_controller_test.rb | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/search/_directory.rhtml b/app/views/search/_directory.rhtml index 7c372fc..246887a 100644 --- a/app/views/search/_directory.rhtml +++ b/app/views/search/_directory.rhtml @@ -1,6 +1,6 @@
- <%= link_to_unless(params[:initial].blank?, _('Recent'), :action => 'assets', :display => params[:display]) %> + <%= link_to_unless(params[:initial].blank?, _('Recent'), params.merge(:action => 'assets', :initial => nil)) %>   - <%= (?a..?z).map { |initial| link_to_unless(params[:initial] == ('' << initial), ('' << initial).upcase, :action => 'directory', :asset => @asset, :initial => ('' << initial), :display => params[:display]) }.join('   ') %> + <%= ('a'..'z').map { |initial| link_to_unless(params[:initial] == initial, initial.upcase, params.merge(:action => 'directory', :asset => @asset, :initial => initial)) }.join('   ') %>

diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 34f284a..f872688 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -519,6 +519,12 @@ class SearchControllerTest < Test::Unit::TestCase assert_tag :tag => 'a', :attributes => { :href => '/assets/people' }, :content => 'Recent' end + should 'not leave category in link to other char in directory' do + cat = Category.create!(:name => 'just_a_category', :environment => Environment.default) + get :directory, :asset => 'people', :initial => 'r', :category_path => cat.path.split('/') + assert_tag :tag => 'a', :attributes => { :href => "/directory/people/k/#{cat.path}" } + end + ############### directory for every kind of asset ################# should 'display people with a given initial' do included = create_user('fergunson').person -- libgit2 0.21.2