mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-11 20:21:10 +00:00
Isolate assertions in v2/notifications intermittent failure cases (#34271)
This commit is contained in:
parent
3edac14f02
commit
e1dbbf6c9d
|
@ -158,14 +158,13 @@ RSpec.describe 'Notifications' do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type)
|
expect(response.content_type)
|
||||||
.to start_with('application/json')
|
.to start_with('application/json')
|
||||||
expect(response.parsed_body[:notification_groups]).to contain_exactly(
|
expect(response.parsed_body[:notification_groups].size)
|
||||||
a_hash_including(
|
.to eq(1)
|
||||||
type: 'favourite',
|
expect(response.parsed_body.dig(:notification_groups, 0))
|
||||||
sample_account_ids: have_attributes(size: 5),
|
.to include(type: 'favourite')
|
||||||
page_min_id: notification_ids.first.to_s,
|
.and(include(sample_account_ids: have_attributes(size: 5)))
|
||||||
page_max_id: notification_ids.last.to_s
|
.and(include(page_max_id: notification_ids.last.to_s))
|
||||||
)
|
.and(include(page_min_id: notification_ids.first.to_s))
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -180,14 +179,13 @@ RSpec.describe 'Notifications' do
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.content_type)
|
expect(response.content_type)
|
||||||
.to start_with('application/json')
|
.to start_with('application/json')
|
||||||
expect(response.parsed_body[:notification_groups]).to contain_exactly(
|
expect(response.parsed_body[:notification_groups].size)
|
||||||
a_hash_including(
|
.to eq(1)
|
||||||
type: 'favourite',
|
expect(response.parsed_body.dig(:notification_groups, 0))
|
||||||
sample_account_ids: have_attributes(size: 5),
|
.to include(type: 'favourite')
|
||||||
page_min_id: notification_ids.first.to_s,
|
.and(include(sample_account_ids: have_attributes(size: 5)))
|
||||||
page_max_id: notification_ids.last.to_s
|
.and(include(page_max_id: notification_ids.last.to_s))
|
||||||
)
|
.and(include(page_min_id: notification_ids.first.to_s))
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user