diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 10fd634aa2a..0c3de7535f7 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -623,6 +623,16 @@ class UserTest < ActiveSupport::TestCase assert target.sent_student_followup_message end + test '#hibernation_elapsed_days' do + user = users(:kyuukai) + + travel_to Time.zone.local(2020, 1, 10) do + elapsed_days = user.hibernation_elapsed_days + + assert assert_equal 9, elapsed_days + end + end + test '#country_name' do assert_equal '日本', users(:kimura).country_name assert_equal '米国', users(:tom).country_name diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 589349354a3..5cd191b74a8 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -629,4 +629,18 @@ class UsersTest < ApplicationSystemTestCase visit_with_auth user_path(user), 'komagata' assert_no_text '休会中 / 休会から' end + + test 'show retirement message on users page' do + visit_with_auth users_path, 'komagata' + click_link('退会') + assert_selector '.users-item__inactive-message-container.is-only-mentor .users-item__inactive-message', text: '退会しました' + end + + test 'show hibernation elasped days message on users page' do + travel_to Time.zone.local(2020, 1, 11, 0, 0, 0) do + visit_with_auth users_path, 'komagata' + click_link('休会') + assert_selector '.users-item__inactive-message-container.is-only-mentor .users-item__inactive-message', text: '休会中: 2020年01月01日〜(10日経過)' + end + end end