Merge remote-tracking branch 'parent/main' into upstream-20240403
This commit is contained in:
commit
479c4fecc1
63 changed files with 831 additions and 391 deletions
|
@ -32,8 +32,8 @@ RSpec.describe 'Policies' do
|
|||
filter_new_accounts: false,
|
||||
filter_private_mentions: true,
|
||||
summary: a_hash_including(
|
||||
pending_requests_count: '1',
|
||||
pending_notifications_count: '0'
|
||||
pending_requests_count: 1,
|
||||
pending_notifications_count: 0
|
||||
)
|
||||
)
|
||||
end
|
||||
|
@ -60,8 +60,8 @@ RSpec.describe 'Policies' do
|
|||
filter_new_accounts: false,
|
||||
filter_private_mentions: true,
|
||||
summary: a_hash_including(
|
||||
pending_requests_count: '0',
|
||||
pending_notifications_count: '0'
|
||||
pending_requests_count: 0,
|
||||
pending_notifications_count: 0
|
||||
)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -25,13 +25,15 @@ describe 'Public' do
|
|||
get '/api/v1/timelines/public', headers: headers, params: params
|
||||
end
|
||||
|
||||
let!(:private_status) { Fabricate(:status, text: 'ohagi', visibility: :private) } # rubocop:disable RSpec/LetSetup
|
||||
let!(:local_status) { Fabricate(:status, text: 'ohagi', account: Fabricate.build(:account, domain: nil)) }
|
||||
let!(:remote_status) { Fabricate(:status, text: 'ohagi', account: Fabricate.build(:account, domain: 'example.com')) }
|
||||
let!(:media_status) { Fabricate(:status, text: 'ohagi', media_attachments: [Fabricate.build(:media_attachment)]) }
|
||||
|
||||
let!(:local_status) { Fabricate(:status, account: Fabricate.build(:account, domain: nil)) }
|
||||
let!(:remote_status) { Fabricate(:status, account: Fabricate.build(:account, domain: 'example.com')) }
|
||||
let!(:media_status) { Fabricate(:status, media_attachments: [Fabricate.build(:media_attachment)]) }
|
||||
let(:params) { {} }
|
||||
|
||||
before do
|
||||
Fabricate(:status, visibility: :private)
|
||||
end
|
||||
|
||||
context 'when the instance allows public preview' do
|
||||
let(:expected_statuses) { [local_status, remote_status, media_status] }
|
||||
|
||||
|
@ -182,7 +184,7 @@ describe 'Public' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when include_quotes' do # rubocop:disable RSpec/MultipleMemoizedHelpers
|
||||
context 'when include_quotes' do
|
||||
let(:with_quote) { true }
|
||||
|
||||
it 'load statuses', :aggregate_failures do
|
||||
|
|
|
@ -18,6 +18,7 @@ describe 'Instances' do
|
|||
expect(body_as_json)
|
||||
.to be_present
|
||||
.and include(title: 'Mastodon')
|
||||
.and include_configuration_limits
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -31,7 +32,26 @@ describe 'Instances' do
|
|||
expect(body_as_json)
|
||||
.to be_present
|
||||
.and include(title: 'Mastodon')
|
||||
.and include_configuration_limits
|
||||
end
|
||||
end
|
||||
|
||||
def include_configuration_limits
|
||||
include(
|
||||
configuration: include(
|
||||
accounts: include(
|
||||
max_featured_tags: FeaturedTag::LIMIT,
|
||||
max_pinned_statuses: StatusPinValidator::PIN_LIMIT
|
||||
),
|
||||
statuses: include(
|
||||
max_characters: StatusLengthValidator::MAX_CHARS,
|
||||
max_media_attachments: 4 # TODO, move to constant somewhere
|
||||
),
|
||||
polls: include(
|
||||
max_options: PollValidator::MAX_OPTIONS
|
||||
)
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue