]> git.openstreetmap.org Git - rails.git/blob - test/controllers/notifications/new_follower_view_test.rb
Merge remote-tracking branch 'upstream/pull/7289'
[rails.git] / test / controllers / notifications / new_follower_view_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 module Notifications
6   class NewFollowerViewTest < ActionView::TestCase
7     def test_render
8       follower = build_stubbed(:user, :display_name => "Follower")
9       follow = build_stubbed(:follow, :follower => follower)
10
11       notification = build_stubbed(
12         :notification,
13         :record => follow,
14         :notifier_class => NewFollowerNotifier
15       )
16
17       render(
18         "notifications/notification",
19         :notification => notification
20       )
21
22       assert_dom ".web-notification" do
23         assert_dom "h2", "New follower"
24         assert_dom "time", "less than 1 minute ago"
25         assert_dom "p", "User Follower started following you. You can follow them back if you wish."
26       end
27     end
28   end
29 end