Requests create a read, rather than unread, notification

This commit is contained in:
Raphael Sofaer 2011-02-16 23:44:25 -05:00
parent 6cf8de94a7
commit cd7e4d6e8f
2 changed files with 9 additions and 3 deletions

View file

@ -68,6 +68,7 @@ private
:action => action,
:recipient_id => recipient.id)
n.actors << actor
n.unread = false if target.is_a? Request
n.save!
n
end

View file

@ -53,6 +53,11 @@ describe Notification do
Notification.notify(@user, @request, @person)
end
it 'creates the notification already read' do
n = Notification.notify(@user, @request, @person)
n.unread?.should be_false
end
it 'sockets to the recipient' do
opts = {:target_id => @request.id,
:target_type => "Request",