Skip to content

Commit

Permalink
Merge pull request #6960 from fjordllc/feature/hibernation_duration_d…
Browse files Browse the repository at this point in the history
…isplay

休会中のユーザーの個別ページに休会から何日経過したか表示する
  • Loading branch information
komagata authored Oct 18, 2023
2 parents 4d22da7 + 600bac3 commit 99aaa37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/views/users/_metas.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions test/system/users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 99aaa37

Please sign in to comment.