Commit 82bfcffc3e0ca2c8368c245755a677d8e68759ed
1 parent
4a81610a
Exists in
master
and in
28 other branches
ActionItem495: fixed
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2093 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
app/views/search/_directory.rhtml
1 | <div class="search-index"> | 1 | <div class="search-index"> |
2 | - <%= link_to_unless(params[:initial].blank?, _('Recent'), :action => 'assets', :display => params[:display]) %> | 2 | + <%= link_to_unless(params[:initial].blank?, _('Recent'), params.merge(:action => 'assets', :initial => nil)) %> |
3 | | 3 | |
4 | - <%= (?a..?z).map { |initial| link_to_unless(params[:initial] == ('' << initial), ('' << initial).upcase, :action => 'directory', :asset => @asset, :initial => ('' << initial), :display => params[:display]) }.join(' ') %> | 4 | + <%= ('a'..'z').map { |initial| link_to_unless(params[:initial] == initial, initial.upcase, params.merge(:action => 'directory', :asset => @asset, :initial => initial)) }.join(' ') %> |
5 | </div> | 5 | </div> |
6 | <br style='clear:both'/> | 6 | <br style='clear:both'/> |
test/functional/search_controller_test.rb
@@ -519,6 +519,12 @@ class SearchControllerTest < Test::Unit::TestCase | @@ -519,6 +519,12 @@ class SearchControllerTest < Test::Unit::TestCase | ||
519 | assert_tag :tag => 'a', :attributes => { :href => '/assets/people' }, :content => 'Recent' | 519 | assert_tag :tag => 'a', :attributes => { :href => '/assets/people' }, :content => 'Recent' |
520 | end | 520 | end |
521 | 521 | ||
522 | + should 'not leave category in link to other char in directory' do | ||
523 | + cat = Category.create!(:name => 'just_a_category', :environment => Environment.default) | ||
524 | + get :directory, :asset => 'people', :initial => 'r', :category_path => cat.path.split('/') | ||
525 | + assert_tag :tag => 'a', :attributes => { :href => "/directory/people/k/#{cat.path}" } | ||
526 | + end | ||
527 | + | ||
522 | ############### directory for every kind of asset ################# | 528 | ############### directory for every kind of asset ################# |
523 | should 'display people with a given initial' do | 529 | should 'display people with a given initial' do |
524 | included = create_user('fergunson').person | 530 | included = create_user('fergunson').person |