1 # frozen_string_literal: true
6 class DiaryCommentViewTest < ActionView::TestCase
8 diary_comment = build_stubbed(:diary_comment)
9 notification = build_stubbed(:notification, :record => diary_comment)
12 "notifications/notification",
13 :notification => notification
16 assert_dom ".web-notification" do
17 assert_dom "h2", "Diary comment"
18 assert_dom "time", "less than 1 minute ago"
19 assert_dom "blockquote", diary_comment.body
23 def test_render_with_long_text
24 comment_user = build_stubbed(
26 :display_name => "Helpful Commenter"
28 diary_entry = build_stubbed(:diary_entry)
29 diary_comment = build_stubbed(
31 :user => comment_user,
32 :diary_entry => diary_entry,
33 :body => read_fixture_file("lorem_ipsum.txt")
35 notification = build_stubbed(:notification, :record => diary_comment)
38 "notifications/notification",
39 :notification => notification
42 assert_dom ".web-notification blockquote p", :count => 3