OMG SO MANY EMAILS, fixed
This commit is contained in:
parent
6fa433ced8
commit
970190fb7a
2 changed files with 29 additions and 11 deletions
|
|
@ -41,6 +41,6 @@ class Like < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def notification_type(user, person)
|
||||
Notifications::Liked unless user.person == person
|
||||
Notifications::Liked if self.post.author == user.person && user.person != person
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -34,6 +34,24 @@ describe Like do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#notification_type' do
|
||||
before do
|
||||
@like = @bob.like(1, :on => @status)
|
||||
end
|
||||
|
||||
it 'should be notifications liked if you are the post owner' do
|
||||
@like.notification_type(@alice, @bob.person).should be Notifications::Liked
|
||||
end
|
||||
|
||||
it 'should not notify you if you are the like-r owner' do
|
||||
@like.notification_type(@bob, @alice.person).should be_nil
|
||||
end
|
||||
|
||||
it 'should not notify you if you did not create the post' do
|
||||
@like.notification_type(@bob, @alice.person).should be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'xml' do
|
||||
before do
|
||||
@liker = Factory.create(:user)
|
||||
|
|
|
|||
Loading…
Reference in a new issue