feat: Update last_snoozed_at after the un-snooze notification (#8943)

This commit is contained in:
Muhsin Keloth
2024-02-20 18:55:39 +05:30
committed by GitHub
parent c5c0845151
commit e6cf8c39b7
6 changed files with 27 additions and 5 deletions

View File

@@ -179,6 +179,7 @@ RSpec.describe 'Notifications API', type: :request do
expect(response).to have_http_status(:success)
expect(notification.reload.snoozed_until).not_to eq('')
expect(notification.reload.meta['last_snoozed_at']).to be_nil
end
end
end

View File

@@ -14,10 +14,13 @@ RSpec.describe Notification::ReopenSnoozedNotificationsJob do
it 'reopens snoozed notifications whose snooze until has passed' do
described_class.perform_now
snoozed_until = snoozed_till_5_minutes_ago.reload.snoozed_until
expect(snoozed_till_5_minutes_ago.reload.snoozed_until).to be_nil
expect(snoozed_till_tomorrow.reload.snoozed_until.to_date).to eq 1.day.from_now.to_date
expect(snoozed_indefinitely.reload.snoozed_until).to be_nil
expect(snoozed_indefinitely.reload.read_at).to be_nil
expect(snoozed_until).to eq(snoozed_till_5_minutes_ago.reload.meta['snoozed_until'])
end
end
end