From 01efec8c6fe96ed49c6cb423c6347d5887d169d2 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Sun, 27 Apr 2008 22:48:40 +0000 Subject: [PATCH] ActionItem310: linking from user-specific tag to general tag --- app/views/profile/tag.rhtml | 4 ++++ test/functional/profile_controller_test.rb | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/app/views/profile/tag.rhtml b/app/views/profile/tag.rhtml index e964835..1cf5857 100644 --- a/app/views/profile/tag.rhtml +++ b/app/views/profile/tag.rhtml @@ -7,3 +7,7 @@ <% end %> + +
+ <%= link_to _('See content tagged with "%s" in the entire site') % @tag, :controller => 'search', :action => 'tag', :tag => @tag %> +
diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index d749845..3c825c3 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -118,4 +118,18 @@ class ProfileControllerTest < Test::Unit::TestCase assert_tag :tag => 'div', :content => 'Recent content', :attributes => { :class => 'block recent-documents-block' }, :child => { :tag => 'ul', :content => /#{person.articles.find_by_path('feed').name}/ } end + should 'display tag for profile' do + @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') + + get :tag, :profile => @profile.identifier, :id => 'tag1' + assert_tag :tag => 'a', :attributes => { :href => /testuser\/testarticle$/ } + end + + should 'link to the same tag but for whole environment' do + @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') + get :tag, :profile => @profile.identifier, :id => 'tag1' + + assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site' + end + end -- libgit2 0.21.2