Skip to content
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

定期イベントでメンション付きのコメントをしたときにメール通知とメッセージが不適切になるバグを修正 #8171

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/concerns/mentioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def target_of_comment(commentable_class, commentable)
Report: "#{commentable.user.login_name}さんの日報「#{commentable.title}」",
Product: "#{commentable.user.login_name}さんの#{commentable.title}",
Event: "特別イベント「#{commentable.title}」",
RegularEvent: "定期イベント「#{commentable.title}」",
Page: "Docs「#{commentable.title}」",
Announcement: "お知らせ「#{commentable.title}」"
}[:"#{commentable_class}"]
Expand Down
9 changes: 9 additions & 0 deletions test/system/notification/regular_events_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,13 @@ class Notification::RegularEventsTest < ApplicationSystemTestCase

assert_requested(stub_message)
end

test 'notify correct message when mentioned' do
regular_event = regular_events(:regular_event1)
visit_with_auth regular_event_path(regular_event), 'komagata'
fill_in 'new_comment[description]', with: '@machida test'
click_button 'コメントする'
visit_with_auth '/notifications', 'machida'
assert_text '定期イベント「開発MTG」へのコメントでkomagataさんからメンションがきました。'
end
end