From ac9a5b1164265f390a08eb3a7d5ef2e0b4c6573f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 1 May 2015 17:06:19 +0200 Subject: [PATCH] Fixed reset of online notifications. --- app/models/observer/ticket/online_notification_seen.rb | 2 +- test/unit/online_notifiaction_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/observer/ticket/online_notification_seen.rb b/app/models/observer/ticket/online_notification_seen.rb index e3cfeebb3..4ed8e791c 100644 --- a/app/models/observer/ticket/online_notification_seen.rb +++ b/app/models/observer/ticket/online_notification_seen.rb @@ -23,6 +23,6 @@ class Observer::Ticket::OnlineNotificationSeen < ActiveRecord::Observer # set all online notifications to seen # send background job - Delayed::Job.enqueue( Observer::Ticket::UserTicketCounter::BackgroundJob.new( record.id ) ) + Delayed::Job.enqueue( Observer::Ticket::OnlineNotificationSeen::BackgroundJob.new( record.id ) ) end end diff --git a/test/unit/online_notifiaction_test.rb b/test/unit/online_notifiaction_test.rb index f1d7fd73e..10646a313 100644 --- a/test/unit/online_notifiaction_test.rb +++ b/test/unit/online_notifiaction_test.rb @@ -299,6 +299,7 @@ class OnlineNotificationTest < ActiveSupport::TestCase ticket_id: tickets[3].id, user_id: 1, ) + Delayed::Worker.new.work_off notifications = OnlineNotification.list_by_object( 'Ticket', tickets[2].id ) assert( !notifications.empty?, 'should have notifications') assert( notification_seen_only_exists_exists(notifications), 'still not seen notifications for merged ticket available') @@ -315,6 +316,7 @@ class OnlineNotificationTest < ActiveSupport::TestCase assert( !found, 'Ticket destroyed') # check if notifications for ticket still exist + Delayed::Worker.new.work_off notifications = OnlineNotification.list_by_object( 'Ticket', ticket_id ) assert( notifications.empty?, 'still notifications for destroyed ticket available') }