diff --git a/app/models/tags_block.rb b/app/models/tags_block.rb
index 0efe43f..12e055e 100644
--- a/app/models/tags_block.rb
+++ b/app/models/tags_block.rb
@@ -14,6 +14,9 @@ class TagsBlock < Block
end
def content
+ tags = owner.tags
+ return '' if tags.empty?
+
block_title( _('tags') ) +
"\n
\n"+
tag_cloud( owner.tags, :id,
diff --git a/test/unit/tags_block_test.rb b/test/unit/tags_block_test.rb
index a3e78c6..a1c8f08 100644
--- a/test/unit/tags_block_test.rb
+++ b/test/unit/tags_block_test.rb
@@ -23,8 +23,9 @@ class TagsBlockTest < Test::Unit::TestCase
assert_match /profile\/testinguser\/tag\/third-tag/, block.content
end
- should 'display owner name in tags' do
- assert_match "testinguser's tags", block.content
+ should 'return (none) when no tags to display' do
+ block.owner.expects(:tags).returns([])
+ assert_equal '', block.content
end
end
--
libgit2 0.21.2