From 45abddb302a44adafdcc0479cc93dea4d8fb4b64 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 13 Jun 2024 16:10:34 +0200 Subject: [PATCH] Fix pagination attributes not being returned in ungroupable-only pages (#30688) --- app/serializers/rest/notification_group_serializer.rb | 2 +- spec/requests/api/v2_alpha/notifications_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/serializers/rest/notification_group_serializer.rb b/app/serializers/rest/notification_group_serializer.rb index 05b51b07a..ce1950c5a 100644 --- a/app/serializers/rest/notification_group_serializer.rb +++ b/app/serializers/rest/notification_group_serializer.rb @@ -45,6 +45,6 @@ class REST::NotificationGroupSerializer < ActiveModel::Serializer end def paginated? - instance_options[:group_metadata].present? + !instance_options[:group_metadata].nil? end end diff --git a/spec/requests/api/v2_alpha/notifications_spec.rb b/spec/requests/api/v2_alpha/notifications_spec.rb index 9bd1a32e9..ac44605ac 100644 --- a/spec/requests/api/v2_alpha/notifications_spec.rb +++ b/spec/requests/api/v2_alpha/notifications_spec.rb @@ -58,6 +58,7 @@ RSpec.describe 'Notifications' do expect(response).to have_http_status(200) expect(body_json_types.uniq).to eq ['mention'] + expect(body_as_json[0][:page_min_id]).to_not be_nil end end