File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
spec/features/notifications Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2222 sign_in_user ( user . email , user . password )
2323 end
2424
25+ it 'will not be marked as read if conversation is not loaded' , :js do
26+ create_list ( :message , 2 , conversation : conversation )
27+ expect ( user . person . notifications . map ( &:read_at ) ) . to all ( eq ( nil ) )
28+ end
29+
2530 it 'marked as read when conversation is loaded' , :js do
2631 create_list ( :message , 2 , conversation : conversation )
2732 visit conversation_path ( id : conversation , person_id : user . person , locale : I18n . default_locale )
2833 expect ( user . person . notifications . map ( &:read_at ) ) . to all ( be_a ( Time ) )
2934 end
35+
36+ # TODO: test for automatic update of read_at when page is active
37+ # it 'marked as read while conversation page is active', :js do
38+ # visit conversation_path(id: conversation, person_id: user.person, locale: I18n.default_locale)
39+ # create_list(:message, 2, conversation: conversation)
40+ # expect(user.person.notifications.map(&:read_at)).to all(be_a(Time))
41+ # end
3042end
You can’t perform that action at this time.
0 commit comments