Commit 01efec8c6fe96ed49c6cb423c6347d5887d169d2

Authored by AntonioTerceiro
1 parent dfce2aab

ActionItem310: linking from user-specific tag to general tag


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1707 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/profile/tag.rhtml
... ... @@ -7,3 +7,7 @@
7 7 <% end %>
8 8 </ul>
9 9 </div>
  10 +
  11 +<div>
  12 + <%= link_to _('See content tagged with "%s" in the entire site') % @tag, :controller => 'search', :action => 'tag', :tag => @tag %>
  13 +</div>
... ...
test/functional/profile_controller_test.rb
... ... @@ -118,4 +118,18 @@ class ProfileControllerTest &lt; Test::Unit::TestCase
118 118 assert_tag :tag => 'div', :content => 'Recent content', :attributes => { :class => 'block recent-documents-block' }, :child => { :tag => 'ul', :content => /#{person.articles.find_by_path('feed').name}/ }
119 119 end
120 120  
  121 + should 'display tag for profile' do
  122 + @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1')
  123 +
  124 + get :tag, :profile => @profile.identifier, :id => 'tag1'
  125 + assert_tag :tag => 'a', :attributes => { :href => /testuser\/testarticle$/ }
  126 + end
  127 +
  128 + should 'link to the same tag but for whole environment' do
  129 + @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1')
  130 + get :tag, :profile => @profile.identifier, :id => 'tag1'
  131 +
  132 + assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site'
  133 + end
  134 +
121 135 end
... ...