Merge commit '9e04007020' into upstream-20240725

This commit is contained in:
KMY 2024-07-25 13:06:26 +09:00
commit a99f174d98
322 changed files with 8093 additions and 1586 deletions

View file

@ -815,7 +815,7 @@ RSpec.describe Account do
expect(results).to eq [match]
end
it 'limits by 10 by default' do
it 'limits result count by default value' do
stub_const('Account::Search::DEFAULT_LIMIT', 1)
2.times { Fabricate(:account, display_name: 'Display Name') }
results = described_class.advanced_search_for('display', account)
@ -998,7 +998,7 @@ RSpec.describe Account do
end
it 'is invalid if the display name is longer than the character limit' do
account = Fabricate.build(:account, display_name: username_over_limit)
account = Fabricate.build(:account, display_name: display_name_over_limit)
account.valid?
expect(account).to model_have_error_on_field(:display_name)
end
@ -1044,7 +1044,7 @@ RSpec.describe Account do
end
it 'is valid even if the display name is longer than the character limit' do
account = Fabricate.build(:account, domain: 'domain', display_name: username_over_limit)
account = Fabricate.build(:account, domain: 'domain', display_name: display_name_over_limit)
account.valid?
expect(account).to_not model_have_error_on_field(:display_name)
end
@ -1060,6 +1060,10 @@ RSpec.describe Account do
'a' * described_class::USERNAME_LENGTH_LIMIT * 2
end
def display_name_over_limit
'a' * described_class::DISPLAY_NAME_LENGTH_LIMIT * 2
end
def account_note_over_limit
'a' * described_class::NOTE_LENGTH_LIMIT * 2
end