-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7627 from fjordllc/bug/not-receive-mail-notificat…
…ion-of-question プラクティス未選択で質問を作成した場合にメール通知が届かないバグの修正
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -264,6 +264,26 @@ class ActivityMailerTest < ActionMailer::TestCase | |
assert_match(%r{<a .+ href="http://localhost:3000/notification/redirector\?#{query}">質問へ</a>}, email.body.to_s) | ||
end | ||
|
||
test 'came_question with no practice' do | ||
question = questions(:question14) | ||
user = question.user | ||
mentor = users(:komagata) | ||
|
||
ActivityMailer.came_question( | ||
sender: user, | ||
receiver: mentor, | ||
question: | ||
).deliver_now | ||
|
||
assert_not ActionMailer::Base.deliveries.empty? | ||
email = ActionMailer::Base.deliveries.last | ||
query = CGI.escapeHTML({ kind: 6, link: "/questions/#{question.id}" }.to_param) | ||
assert_equal ['[email protected]'], email.from | ||
assert_equal ['[email protected]'], email.to | ||
assert_equal '[FBC] kimuraさんから質問「プラクティスを選択せずに登録したテストの質問」が投稿されました。', email.subject | ||
assert_match(%r{<a .+ href="http://localhost:3000/notification/redirector\?#{query}">質問へ</a>}, email.body.to_s) | ||
end | ||
|
||
test 'mentioned' do | ||
mentionable = comments(:comment9) | ||
mentioned = notifications(:notification_mentioned) | ||
|