-
Notifications
You must be signed in to change notification settings - Fork 74
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
提出物を更新した時の通知の文面を変更した #6772
提出物を更新した時の通知の文面を変更した #6772
Conversation
お疲れ様です🍵 急ぎではありませんので、よろしくお願いいたします🙏 |
@Kassy0220 |
7ddc292
to
9d3dbc7
Compare
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.
遅くなってしまいすいませんでした!
1点だけコメントさせていただきました。
細かいことなんですが、PRのタイトルが「提出物を更新した時の…」の方が適当かと思いました。
よろしくお願いします🙏
@@ -24,8 +24,9 @@ def notify_advisers(product) | |||
end | |||
|
|||
def send_notification(product:, receivers:) | |||
notification = product.updated_after_submission? ? :product_update : :submitted |
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.
こことproduct_notifier_for_practice_watcher.rbに追加されてる同処理はあえて重複させているのでしょうか?
例えばproduct.rbにnotification_typeみたいなメソッドを作ってそこで判断させれば、notifyの()内で直接呼び出せ、DRYにできる気がしました。
あえて重複させている理由があれば教えてください~🙏
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.
この箇所は重複させている意味はなく、私の見落としになります💦
通知のタイプを判断するメソッドを追加しました。
def notification_type
updated_after_submission? ? :product_update : :submitted
end
notification_type
で通知の種類を提供することで、通知を送る側(product_notifier_for_practice_watcher.rbなど)はそれを利用すれば良く、役割が分かりやすくなりました。
テストコードも何をテストしているのか分かりやすくなったので、コードがよりよくなったと思います🙌
@rira100000000 ご指摘の箇所(PRのタイトルとコードの重複)を修正しましたので、ご確認をよろしくお願いいたします🙏 |
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.
修正ありがとうございます!
テストもわかりやすくなっていい感じですね!
approveとさせていただきます~。
@rira100000000 @komagata |
a777540
to
58f405b
Compare
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.
テストが落ちているようです。
テストが成功してからのレビュー依頼をお願いします。
58f405b
to
0f99e33
Compare
@komagata |
0f99e33
to
ffba731
Compare
@@ -196,4 +196,14 @@ def delete_last_commented_at | |||
def delete_commented_at | |||
update_commented_at(comments.last) | |||
end | |||
|
|||
def notification_type |
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.
👍
test/models/product_test.rb
Outdated
@@ -159,4 +159,35 @@ class ProductTest < ActiveSupport::TestCase | |||
product_id_list = Product.self_assigned_no_replied_products(mentor.id).pluck(:id) | |||
assert_not_includes product_id_list, no_replied_wip_product.id | |||
end | |||
|
|||
test '#notification_type return :product_update when product is updated after submission' do |
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.
モデルのテストなので下記のように単純にメソッドに対応したテストで良いかもです。
test '#notification_type' do
# ...
end
test '#updated_after_submission?' do
# ...
end
(すでにある既存のテストもその方が望ましいですがレビューで漏れていたようです。そのうち直したい…)
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.
次のコミットでテスト名を修正し、2つに分けていた#notification_type
のテストを一つにまとめました。
101a5aa
また、次のコミットで#updated_after_submission?
のテストを追加しました。
1ea6a37
既存のテスト名が好ましくない箇所を修正するIssueも作成しました。
Productモデルのテスト名を修正したい · Issue #6835 · fjordllc/bootcamp
修正もできるだけ早く行いますので、よろしくお願いします🙏
ffba731
to
5001ab6
Compare
35ebdd6
to
1ea6a37
Compare
@komagata |
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.
確認させて頂きました。OKです〜🙆♂️
Issue
概要
以下の2つの通知に関して、提出物が更新された場合に飛ぶ通知の文面が
〇〇さんが「×××」の提出物を提出しました。
となっていたのを、〇〇さんの提出物が更新されました
となるよう変更しました。変更確認方法
最初に、次の下準備をお願いします。
feature/change-notification-message-when-product-is-updated
をローカルに取り込むforeman start -f Procfile.dev
でサーバを起動提出物を提出し、更新した場合
kensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認するkensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認するkensyuさんの提出物が更新されました
という通知が来ていることを確認するkensyuさんの提出物が更新されました
という通知が来ていることを確認する7まで確認が終わったら、次の確認に備えて2で作成した提出物を削除します。
最初に提出物をWIPで保存し、提出した場合
kensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認するkensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認する5まで確認が終わったら、次の確認に備えて2で保存した提出物を削除します。
提出物を提出し、WIPで保存し、更新した場合
kensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認するkensyuさんが「Terminalの基礎を覚える」の提出物を提出しました
という通知が来ていることを確認するkensyuさんの提出物が更新されました
という通知が来ていることを確認するkensyuさんの提出物が更新されました
という通知が来ていることを確認するScreenshot
変更前
変更後