diff --git a/app/views/products/_tabs.html.slim b/app/views/products/_tabs.html.slim
index c9da1e9edba..ad380d195b7 100644
--- a/app/views/products/_tabs.html.slim
+++ b/app/views/products/_tabs.html.slim
@@ -24,5 +24,6 @@
li.page-tabs__item.is-only-mentor
= link_to products_self_assigned_index_path, class: "page-tabs__item-link #{current_link(/^products-self_assigned-index/)}" do
| 自分の担当 (#{Product.self_assigned_product(current_user.id).size})
- .page-tabs__item-count.a-notification-count.is-only-mentor
- = Cache.self_assigned_no_replied_product_count(current_user.id)
+ - if Cache.self_assigned_no_replied_product_count(current_user.id).positive?
+ .page-tabs__item-count.a-notification-count.is-only-mentor
+ = Cache.self_assigned_no_replied_product_count(current_user.id)
diff --git a/test/system/products_test.rb b/test/system/products_test.rb
index 476f71c284a..9070806d29b 100644
--- a/test/system/products_test.rb
+++ b/test/system/products_test.rb
@@ -297,21 +297,20 @@ class ProductsTest < ApplicationSystemTestCase
test 'be person on charge at comment on product of there are not person on charge' do
visit_with_auth products_not_responded_index_path, 'machida'
def assigned_product_count
- find_link('自分の担当').find('.page-tabs__item-count').text.to_i
+ text[/自分の担当 ((\d+))/, 1].to_i
end
before_comment = assigned_product_count
[
'担当者がいない提出物の場合、担当者になる',
- '自分が担当者の場合、担当者のまま',
- 'タブ上の数字は未返信の数字のため、返信するとカウントされない'
+ '自分が担当者の場合、担当者のまま'
].each do |comment|
visit "/products/#{products(:product1).id}"
post_comment(comment)
visit products_not_responded_index_path
- assert_equal before_comment, assigned_product_count
+ assert_equal before_comment + 1, assigned_product_count
end
end
@@ -325,7 +324,7 @@ def assigned_product_count
visit_with_auth products_not_responded_index_path, 'machida'
def assigned_product_count
- find_link('自分の担当').find('.page-tabs__item-count').text.to_i
+ text[/自分の担当 ((\d+))/, 1].to_i
end
before_comment = assigned_product_count