diff --git a/app/jobs/notify_mentioned_users_job.rb b/app/jobs/notify_mentioned_users_job.rb index d8da349..59d59ba 100644 --- a/app/jobs/notify_mentioned_users_job.rb +++ b/app/jobs/notify_mentioned_users_job.rb @@ -19,7 +19,7 @@ class NotifyMentionedUsersJob < Struct.new(:tracked_action_id) people_identifiers -= [mention_creator.identifier] followers = mention_creator.followers - people_idenfifiers -= followers.map(&:identifier) if (followers.present? && remove_followers) + people_identifiers -= followers.map(&:identifier) if (followers.present? && remove_followers) return if people_identifiers.empty? diff --git a/test/unit/notify_mentioned_users_job_test.rb b/test/unit/notify_mentioned_users_job_test.rb index b792d70..2bd7145 100644 --- a/test/unit/notify_mentioned_users_job_test.rb +++ b/test/unit/notify_mentioned_users_job_test.rb @@ -88,9 +88,27 @@ class NotifyMentionedUsersJobTest < ActiveSupport::TestCase end should 'not create notification from mention if the mentioned users are also followers' do - end + circle = Circle.create!(:person=> @person3, :name => "Zombies", :profile_type => 'Person') + @person3.follow(@person1, circle) + process_delayed_job_queue + ActionTrackerNotification.delete_all - should 'not show notification from mention on the authors wall' do - end + s = Scrap.new + s.sender = @person1 + s.receiver = @person2 + s.content = "Run @third, run!!!" + s.save! + action_tracker = ActionTracker::Record.create(:user => @person1, :target => s, + :verb => 'notify_mentioned_users', + :params => {"content" => s.content, "url"=>s.receiver.url}) + + job = NotifyMentionedUsersJob.new(action_tracker.id) + job.perform + process_delayed_job_queue + + assert_equal 2, ActionTrackerNotification.count + assert_not_includes ActionTrackerNotification.all.map{|a|a.action_tracker.verb}, "notify_mentioned_users" + assert_equal ActionTrackerNotification.all.map{|a|a.action_tracker.verb}, ["leave_scrap","leave_scrap"] + end end -- libgit2 0.21.2