ユーザーが休会した時にメンターと管理者にサイト内通知とメール通知が行くようにした#5454
Conversation
d035c39 to
37ae72f
Compare
6a078b6 to
eb48cfa
Compare
1. 分離せずにNotificationFacade経由で呼び出すと同じ通知が複数回discordに飛ぶため
37ae72f to
cc888f7
Compare
| fill_in 'user[times_url]', with: 'https://example.com/channels/1234/5678/' | ||
| click_button '更新する' | ||
| assert_text '分報チャンネル URL は Discord のチャンネル URL を入力してください' | ||
| assert_text '分報チャンネル URLはDiscordのチャンネルURLを入力してください' |
There was a problem hiding this comment.
今回のissueとは関係がありませんが、テストを通すため修正しました
|
@yuma-matsui |
|
@keiz1213 |
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| click_button '休会する' | ||
| page.driver.browser.switch_to.alert.accept |
There was a problem hiding this comment.
ダイアログの確認についてはCapybaraのaccept_confirmメソッドを使った方が良さそうです。
accept_confirm do
click_button '休会する'
endThere was a problem hiding this comment.
確かにこちらのほうがスッキリ書けてわかりやすいです!スッキリ書けるだけではなく他にも色々メリットがあるのですね💡勉強になります。こちら修正しました。
| 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さんが休会しました。' |
There was a problem hiding this comment.
text: ' kimuraさんが休会しました。'
こちら余計なspaceが含まれてしまっているかもです。
There was a problem hiding this comment.
全然気づきませんでした😅こちら修正しました。
| 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さんが休会しました。' |
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| click_button '休会する' | ||
| page.driver.browser.switch_to.alert.accept |
| 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さんが休会しました。' |
| fill_in 'hibernation[scheduled_return_on]', with: Time.current.next_month | ||
| fill_in 'hibernation[reason]', with: 'テストのため' | ||
| click_button '休会する' | ||
| page.driver.browser.switch_to.alert.accept |
yuma-matsui
left a comment
There was a problem hiding this comment.
@keiz1213
お疲れ様です。
いくつかコメントしました!
ご確認をお願いします。
|
@yuma-matsui |
yuma-matsui
left a comment
There was a problem hiding this comment.
修正ありがとうございます!!
LGTMです🙆♂️
|
@komagata |
issue
概要
ユーザーが休会した時に管理者、メンターに
サイト内通知とメール通知が行われるようにしました。備考
サイト内通知とメール通知になります。DiscordNotifierの呼び出し方法について
実装済みのDiscord通知では同じ通知が複数回通知されてしまうため、DiscordNotifierの呼び出しをNotificationFacadeから独立させました。
Discordへの通知を確認するための準備
Discordへの通知を確認するために自身のDiscordアカウントで
をお願いいたします。
確認用のサーバーの作成とwebhookURLの取得方法
取得したwebhookURLをローカルのマシンの環境変数に設定をお願いします。
変更確認方法
feature/notification-of-hibernationをローカルに取り込む。rails sでサーバーを立ち上げるkomagata、machida、mentormentaro、adminonly、unadmentor、でログインする通知をクリックし、休会通知が来ていないことを確認する。(mentormentaroの場合、hatsunoが休会しました。という通知がありますが無視してください)kimuraでログインし、ヘッダーのユーザーメニューから休会手続きを行う。通知をクリックし、kimuraの休会通知が来ていることを確認する。