From 8275cdd7d1d2146554d092a46f75e1e91ef6531e Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 20 Dec 2023 13:25:01 +0530 Subject: [PATCH] chore: fix remaining specs --- spec/finders/notification_finder_spec.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/spec/finders/notification_finder_spec.rb b/spec/finders/notification_finder_spec.rb index f00d6ef6e..2c0adb945 100644 --- a/spec/finders/notification_finder_spec.rb +++ b/spec/finders/notification_finder_spec.rb @@ -7,9 +7,10 @@ describe NotificationFinder do let!(:user) { create(:user, account: account) } before do - create(:notification, account: account, user: user, updated_at: DateTime.now.utc + 1.day) - create(:notification, account: account, user: user, snoozed_until: DateTime.now.utc + 3.days, updated_at: DateTime.now.utc) - create(:notification, account: account, user: user, updated_at: DateTime.now.utc + 2.days) + create(:notification, account: account, user: user, updated_at: DateTime.now.utc + 1.day, last_activity_at: DateTime.now.utc + 1.day) + create(:notification, account: account, user: user, snoozed_until: DateTime.now.utc + 3.days, updated_at: DateTime.now.utc, + last_activity_at: DateTime.now.utc) + create(:notification, account: account, user: user, updated_at: DateTime.now.utc + 2.days, last_activity_at: DateTime.now.utc + 2.days) end describe '#perform' do @@ -31,12 +32,13 @@ describe NotificationFinder do end end - context 'when order by updated_at' do + context 'when order by last_activity_at' do let(:params) { { status: 'open' } } it 'returns all notifications' do result = notification_finder.perform - expect(result.first.updated_at).to be > result.last.updated_at + expect(result.first.last_activity_at).to be > result.last.last_activity_at + expect(result.first.last_activity_at).to be > result.last.last_activity_at end end end