File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
spec/features/notifications Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require 'rails_helper'
4+
5+ RSpec . describe 'message notifications' , type : :feature do
6+ include BetterTogether ::DeviseSessionHelpers
7+
8+ let ( :user ) { create ( :user , :confirmed ) }
9+ let ( :conversation ) { create ( :conversation ) }
10+ let! ( :conversation_participant ) do
11+ create ( :conversation_participant ,
12+ conversation : conversation ,
13+ person : user . person )
14+ end
15+ let ( :cp ) do
16+ create ( :conversation_participant ,
17+ conversation : conversation )
18+ end
19+
20+ before do
21+ configure_host_platform
22+ sign_in_user ( user . email , user . password )
23+ end
24+
25+ it 'marked as read when conversation is loaded' , :js do
26+ create_list ( :message , 2 , conversation : conversation )
27+ visit conversation_path ( id : conversation , person_id : user . person , locale : I18n . default_locale )
28+ expect ( user . person . notifications . map ( &:read_at ) ) . to all ( be_a ( Time ) )
29+ end
30+ end
You can’t perform that action at this time.
0 commit comments