Commit fe65f8f7ad034020b50167bd06e7d1bbb97b505b
1 parent
279a1e7d
Exists in
master
and in
29 other branches
ActionItem313: display just name instead of full_name
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1693 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
app/views/search/index.rhtml
1 | -<h2> <%=h @category ? (_('Search results for "%{query}" in %{category}') % { :query => @query, :category => @category.full_name}) : (_('Search results for "%s"') % @query) %> </h2> | |
1 | +<h2> <%=h @category ? (_('Search results for "%{query}" in "%{category}"') % { :query => @query, :category => @category.name}) : (_('Search results for "%s"') % @query) %> </h2> | |
2 | 2 | |
3 | 3 | <%= render :partial => 'display_results' %> |
4 | 4 | ... | ... |
test/functional/search_controller_test.rb
... | ... | @@ -493,5 +493,13 @@ class SearchControllerTest < Test::Unit::TestCase |
493 | 493 | get :index, :category_path => [ 'my-category' ], :query => 'a sample search' |
494 | 494 | assert_tag :tag => 'a', :attributes => { :href => "/search?query=a+sample+search" }, :content => 'Search for "a sample search" in the whole site' |
495 | 495 | end |
496 | + | |
497 | + should 'display only category name in "search results for ..." title' do | |
498 | + parent = Category.create!(:name => 'Parent Category', :environment => Environment.default) | |
499 | + child = Category.create!(:name => "Child Category", :environment => Environment.default, :parent => parent) | |
500 | + | |
501 | + get :index, :category_path => [ 'parent-category', 'child-category' ], :query => 'a sample search' | |
502 | + assert_tag :tag => 'h2', :content => /Search results for "a sample search" in "Child Category"/ | |
503 | + end | |
496 | 504 | |
497 | 505 | end | ... | ... |