Commit 4d2271f4a42c43c9cb2d13f8ce5170bce04655ce
1 parent
e6301cec
Exists in
master
and in
29 other branches
ActionItem310: pointing tags to profile-specific tag listing +
displaying proper title for article's tags git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1705 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
18 additions
and
1 deletions
Show diff stats
app/views/content_viewer/view_page.rhtml
... | ... | @@ -30,7 +30,8 @@ |
30 | 30 | <% end %> |
31 | 31 | |
32 | 32 | <div class="article-tags"> |
33 | -<%= @page.tags.map { |t| link_to(t, tag_url(:tag => t.name)) }.join("\n") %> | |
33 | + <%= _("This article's tags:") %> | |
34 | + <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %> | |
34 | 35 | </div> |
35 | 36 | |
36 | 37 | <% if @page.parent && !@page.parent.path.blank? %> | ... | ... |
test/functional/content_viewer_controller_test.rb
... | ... | @@ -211,4 +211,20 @@ class ContentViewerControllerTest < Test::Unit::TestCase |
211 | 211 | assert_no_tag :tag => 'strong', :attributes => { :id => 'html_test_comment' } |
212 | 212 | end |
213 | 213 | |
214 | + should "display current article's tags" do | |
215 | + page = profile.articles.create!(:name => 'myarticle', :body => 'test article', :tag_list => 'tag1, tag2') | |
216 | + | |
217 | + get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ] | |
218 | + assert_tag :tag => 'div', :attributes => { :class => 'article-tags' }, :descendant => { | |
219 | + :tag => 'a', | |
220 | + :attributes => { :href => "/profile/#{profile.identifier}/tag/tag1" } | |
221 | + } | |
222 | + assert_tag :tag => 'div', :attributes => { :class => 'article-tags' }, :descendant => { | |
223 | + :tag => 'a', | |
224 | + :attributes => { :href => "/profile/#{profile.identifier}/tag/tag2" } | |
225 | + } | |
226 | + | |
227 | + assert_tag :tag => 'div', :attributes => { :class => 'article-tags' }, :descendant => { :content => /This article's tags:/ } | |
228 | + end | |
229 | + | |
214 | 230 | end | ... | ... |