parent
d8ed529f92
commit
00588e1ef8
2 changed files with 6 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ class Notification < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.notify(recipient, target, actor)
|
||||
return nil unless target.respond_to? :notification_type
|
||||
return nil unless target.respond_to?(:notification_type) && recipient.person != actor
|
||||
|
||||
note_type = target.notification_type(recipient, actor)
|
||||
return nil unless note_type
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ describe Notification, :type => :model do
|
|||
Notification.notify(@user, @request, @person)
|
||||
end
|
||||
|
||||
it "does nothing if told to notify oneself" do
|
||||
notification = Notification.notify(@user, @request, @user.person)
|
||||
expect(notification).to eq(nil)
|
||||
end
|
||||
|
||||
describe '#emails_the_user' do
|
||||
it 'calls mail' do
|
||||
opts = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue