diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml
index b954212..df32fad 100644
--- a/app/views/content_viewer/view_page.rhtml
+++ b/app/views/content_viewer/view_page.rhtml
@@ -45,10 +45,12 @@
<% end %>
-
- <%= _("This article's tags:") %>
- <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %>
-
+<% if !@page.tags.empty? %>
+
+ <%= _("This article's tags:") %>
+ <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %>
+
+<% end %>
<% if @page.parent && !@page.parent.path.blank? %>
diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb
index d9d3ea5..d971c86 100644
--- a/test/functional/content_viewer_controller_test.rb
+++ b/test/functional/content_viewer_controller_test.rb
@@ -273,6 +273,14 @@ class ContentViewerControllerTest < Test::Unit::TestCase
assert_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ }
end
+ should "not display current article's tags" do
+ page = profile.articles.create!(:name => 'myarticle', :body => 'test article')
+
+ get :view_page, :profile => profile.identifier, :page => [ 'myarticle' ]
+ assert_no_tag :tag => 'div', :attributes => { :id => 'article-tags' }
+ assert_no_tag :tag => 'div', :attributes => { :id => 'article-tags' }, :descendant => { :content => /This article's tags:/ }
+ end
+
should 'not display forbidden articles' do
profile.articles.create!(:name => 'test')
profile.update_attributes!(:public_content => false)
--
libgit2 0.21.2