diff --git a/app/views/users/_metas.html.slim b/app/views/users/_metas.html.slim index edce6a1d3d7..9bb0e45bfae 100644 --- a/app/views/users/_metas.html.slim +++ b/app/views/users/_metas.html.slim @@ -54,6 +54,7 @@ - user.roles.each do |role| li = t "target.#{role}" + = " / 休会から#{(Time.current.to_date - user.hibernated_at.to_date).to_i}日目" if role == 'hibernationed' - if user.trainee? && user.training_ends_on? .user-metas__item .user-metas__item-label diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 039063b70e0..589349354a3 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -617,4 +617,16 @@ class UsersTest < ApplicationSystemTestCase click_link('アドバイザー') assert_no_selector '.card-counts__items' end + + test 'show hibernation period in profile' do + hibernated_user = users(:kyuukai) + user = users(:hatsuno) + + travel_to hibernated_user.hibernated_at + 30.days do + visit_with_auth user_path(hibernated_user), 'komagata' + assert_text '休会中 / 休会から30日目' + end + visit_with_auth user_path(user), 'komagata' + assert_no_text '休会中 / 休会から' + end end