-
Notifications
You must be signed in to change notification settings - Fork 75
ユーザーが休会した時にメンターと管理者にサイト内通知とメール通知が行くようにした #5454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
komagata
merged 10 commits into
feature/comeback
from
feature/notification-of-hibernation
Sep 14, 2022
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
64dfbb6
ユーザーが休会した時にメンターと管理者にサイト内通知とメール通知が行くようにした
keiz1213 93b2c6f
テスト追加
keiz1213 1632dbc
テスト修正
keiz1213 f2998ca
研修生とアドバイザーのテストシナリオを追加
keiz1213 cc888f7
DiscordNotifierをNotificationFacadeのhibernatedから分離
keiz1213 269ceb1
activity_notifierの非同期通知のテストを修正
keiz1213 90ba6b5
エラーメッセージの不要なスペースを削除
keiz1213 f12032f
discord通知のテストを追加
keiz1213 013ff46
システムテストの不要なスペースの削除とaccept_confirmの使用
keiz1213 8cd9e74
lint修正
keiz1213 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| require 'application_system_test_case' | ||
|
|
||
| class Notification::HibernationTest < ApplicationSystemTestCase | ||
| setup do | ||
| @delivery_mode = AbstractNotifier.delivery_mode | ||
| AbstractNotifier.delivery_mode = :normal | ||
| end | ||
|
|
||
| teardown do | ||
| AbstractNotifier.delivery_mode = @delivery_mode | ||
| end | ||
|
|
||
| test 'notify admins and mentors when a student hibernate' do | ||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item') do | ||
| assert_no_selector '.card-list-item-title__link-label', text: 'kimuraさんが休会しました。' | ||
| end | ||
|
|
||
| visit_with_auth new_hibernation_path, 'kimura' | ||
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| accept_confirm do | ||
| click_button '休会する' | ||
| end | ||
| assert_text '休会処理が完了しました' | ||
|
|
||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item.is-unread') do | ||
| assert_selector '.card-list-item-title__link-label', text: 'kimuraさんが休会しました。' | ||
| end | ||
| end | ||
|
|
||
| test 'notify admins and mentors when a trainee hibernate' do | ||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item') do | ||
| assert_no_selector '.card-list-item-title__link-label', text: 'kensyuさんが休会しました。' | ||
| end | ||
|
|
||
| visit_with_auth new_hibernation_path, 'kensyu' | ||
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| accept_confirm do | ||
| click_button '休会する' | ||
| end | ||
| assert_text '休会処理が完了しました' | ||
|
|
||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item.is-unread') do | ||
| assert_selector '.card-list-item-title__link-label', text: 'kensyuさんが休会しました。' | ||
| end | ||
| end | ||
|
|
||
| test 'notify admins and mentors when a adviser hibernate' do | ||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item') do | ||
| assert_no_selector '.card-list-item-title__link-label', text: 'senpaiさんが休会しました。' | ||
| end | ||
|
|
||
| visit_with_auth new_hibernation_path, 'senpai' | ||
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| accept_confirm do | ||
| click_button '休会する' | ||
| end | ||
| assert_text '休会処理が完了しました' | ||
|
|
||
| visit_with_auth notifications_path, 'komagata' | ||
| find('#notifications.loaded', wait: 10) | ||
| within first('.card-list-item.is-unread') do | ||
| assert_selector '.card-list-item-title__link-label', text: 'senpaiさんが休会しました。' | ||
| end | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今回のissueとは関係がありませんが、テストを通すため修正しました