Update notification_finder_spec.rb
This commit is contained in:
@@ -7,9 +7,9 @@ describe NotificationFinder do
|
||||
let!(:user) { create(:user, account: account) }
|
||||
|
||||
before do
|
||||
create(:notification, account: account, user: user)
|
||||
create(:notification, account: account, user: user)
|
||||
create(:notification, account: account, user: user, snoozed_until: DateTime.now.utc + 1.day)
|
||||
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)
|
||||
end
|
||||
|
||||
describe '#perform' do
|
||||
@@ -30,5 +30,14 @@ describe NotificationFinder do
|
||||
expect(result.length).to be 3
|
||||
end
|
||||
end
|
||||
|
||||
context 'when order by updated_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
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user