Merge remote-tracking branch 'parent/main' into upstream-20250328
This commit is contained in:
commit
12ed20b6d5
257 changed files with 3505 additions and 2010 deletions
|
@ -158,19 +158,18 @@ RSpec.describe 'Notifications' do
|
|||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:notification_groups]).to contain_exactly(
|
||||
a_hash_including(
|
||||
type: 'favourite',
|
||||
sample_account_ids: have_attributes(size: 5),
|
||||
page_min_id: notification_ids.first.to_s,
|
||||
page_max_id: notification_ids.last.to_s
|
||||
)
|
||||
)
|
||||
expect(response.parsed_body[:notification_groups].size)
|
||||
.to eq(1)
|
||||
expect(response.parsed_body.dig(:notification_groups, 0))
|
||||
.to include(type: 'favourite')
|
||||
.and(include(sample_account_ids: have_attributes(size: 5)))
|
||||
.and(include(page_max_id: notification_ids.last.to_s))
|
||||
.and(include(page_min_id: notification_ids.first.to_s))
|
||||
end
|
||||
end
|
||||
|
||||
context 'with min_id param' do
|
||||
let(:params) { { min_id: user.account.notifications.reload.first.id - 1 } }
|
||||
let(:params) { { min_id: user.account.notifications.order(id: :asc).first.id - 1 } }
|
||||
|
||||
it 'returns a notification group covering all notifications' do
|
||||
subject
|
||||
|
@ -180,14 +179,13 @@ RSpec.describe 'Notifications' do
|
|||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:notification_groups]).to contain_exactly(
|
||||
a_hash_including(
|
||||
type: 'favourite',
|
||||
sample_account_ids: have_attributes(size: 5),
|
||||
page_min_id: notification_ids.first.to_s,
|
||||
page_max_id: notification_ids.last.to_s
|
||||
)
|
||||
)
|
||||
expect(response.parsed_body[:notification_groups].size)
|
||||
.to eq(1)
|
||||
expect(response.parsed_body.dig(:notification_groups, 0))
|
||||
.to include(type: 'favourite')
|
||||
.and(include(sample_account_ids: have_attributes(size: 5)))
|
||||
.and(include(page_max_id: notification_ids.last.to_s))
|
||||
.and(include(page_min_id: notification_ids.first.to_s))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue