X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/a2aa44e026f0f796f046a58d2ad3778e6e79f960..d0092199871708580301c38d375dc3f7dda9285a:/test/controllers/diary_comments_controller_test.rb diff --git a/test/controllers/diary_comments_controller_test.rb b/test/controllers/diary_comments_controller_test.rb index fa978d606..a06565aa1 100644 --- a/test/controllers/diary_comments_controller_test.rb +++ b/test/controllers/diary_comments_controller_test.rb @@ -115,14 +115,14 @@ class DiaryCommentsControllerTest < ActionDispatch::IntegrationTest end end end - assert_redirected_to diary_entry_path(entry.user, entry) + comment = DiaryComment.last + assert_redirected_to diary_entry_path(entry.user, entry, :anchor => "comment#{comment.id}") email = ActionMailer::Base.deliveries.first assert_equal [user.email], email.to assert_equal "[OpenStreetMap] #{other_user.display_name} commented on a diary entry", email.subject assert_match(/New comment/, email.text_part.decoded) assert_match(/New comment/, email.html_part.decoded) ActionMailer::Base.deliveries.clear - comment = DiaryComment.order(:id).last assert_equal entry.id, comment.diary_entry_id assert_equal other_user.id, comment.user_id assert_equal "New comment", comment.body @@ -157,14 +157,14 @@ class DiaryCommentsControllerTest < ActionDispatch::IntegrationTest end end end - assert_redirected_to diary_entry_path(entry.user, entry) + comment = DiaryComment.last + assert_redirected_to diary_entry_path(entry.user, entry, :anchor => "comment#{comment.id}") email = ActionMailer::Base.deliveries.first assert_equal [user.email], email.to assert_equal "[OpenStreetMap] #{other_user.display_name} commented on a diary entry", email.subject assert_match %r{http://example.com/spam}, email.text_part.decoded assert_match %r{http://example.com/spam}, email.html_part.decoded ActionMailer::Base.deliveries.clear - comment = DiaryComment.order(:id).last assert_equal entry.id, comment.diary_entry_id assert_equal other_user.id, comment.user_id assert_equal spammy_text, comment.body