Requests create a read, rather than unread, notification
This commit is contained in:
parent
6cf8de94a7
commit
cd7e4d6e8f
2 changed files with 9 additions and 3 deletions
|
|
@ -68,6 +68,7 @@ private
|
||||||
:action => action,
|
:action => action,
|
||||||
:recipient_id => recipient.id)
|
:recipient_id => recipient.id)
|
||||||
n.actors << actor
|
n.actors << actor
|
||||||
|
n.unread = false if target.is_a? Request
|
||||||
n.save!
|
n.save!
|
||||||
n
|
n
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,11 @@ describe Notification do
|
||||||
Notification.notify(@user, @request, @person)
|
Notification.notify(@user, @request, @person)
|
||||||
end
|
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
|
it 'sockets to the recipient' do
|
||||||
opts = {:target_id => @request.id,
|
opts = {:target_id => @request.id,
|
||||||
:target_type => "Request",
|
:target_type => "Request",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue