Merge remote-tracking branch 'parent/main' into upstream-20240109

This commit is contained in:
KMY 2025-01-09 13:20:56 +09:00
commit d35fa72842
333 changed files with 4444 additions and 2541 deletions

View file

@ -85,7 +85,7 @@ RSpec.describe 'credentials API' do
end
describe 'with invalid data' do
let(:params) { { note: 'This is too long. ' * 30 } }
let(:params) { { note: 'a' * 2 * Account::NOTE_LENGTH_LIMIT } }
it 'returns http unprocessable entity' do
subject

View file

@ -29,7 +29,7 @@ RSpec.describe 'Accounts Notes API' do
end
context 'when account note exceeds allowed length', :aggregate_failures do
let(:comment) { 'a' * 2_001 }
let(:comment) { 'a' * AccountNote::COMMENT_SIZE_LIMIT * 2 }
it 'does not create account note' do
subject

View file

@ -3,7 +3,7 @@
require 'rails_helper'
RSpec.describe 'Admin Dimensions' do
let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let(:user) { Fabricate(:admin_user) }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
let(:account) { Fabricate(:account) }

View file

@ -3,7 +3,7 @@
require 'rails_helper'
RSpec.describe 'Admin Measures' do
let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let(:user) { Fabricate(:admin_user) }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
let(:account) { Fabricate(:account) }

View file

@ -3,7 +3,7 @@
require 'rails_helper'
RSpec.describe 'Admin Retention' do
let(:user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let(:user) { Fabricate(:admin_user) }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
let(:account) { Fabricate(:account) }

View file

@ -122,7 +122,7 @@ RSpec.describe 'Apps' do
end
context 'with a too-long name' do
let(:client_name) { 'hoge' * 20 }
let(:client_name) { 'a' * Doorkeeper::Application::APP_NAME_LIMIT * 2 }
it 'returns http unprocessable entity' do
subject
@ -134,7 +134,7 @@ RSpec.describe 'Apps' do
end
context 'with a too-long website' do
let(:website) { "https://foo.bar/#{'hoge' * 2_000}" }
let(:website) { "https://foo.bar/#{'a' * Doorkeeper::Application::APP_WEBSITE_LIMIT * 2}" }
it 'returns http unprocessable entity' do
subject
@ -146,7 +146,7 @@ RSpec.describe 'Apps' do
end
context 'with a too-long redirect_uri' do
let(:redirect_uris) { "https://app.example/#{'hoge' * 2_000}" }
let(:redirect_uris) { "https://app.example/#{'a' * Doorkeeper::Application::APP_REDIRECT_URI_LIMIT * 2}" }
it 'returns http unprocessable entity' do
subject

View file

@ -13,7 +13,7 @@ RSpec.describe 'Reports' do
post '/api/v1/reports', headers: headers, params: params
end
let!(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
let!(:admin) { Fabricate(:admin_user) }
let(:status) { Fabricate(:status) }
let(:target_account) { status.account }
let(:category) { 'other' }

View file

@ -33,7 +33,7 @@ RSpec.describe 'Media API', :attachment_processing do
let(:params) do
{
file: fixture_file_upload('attachment-jpg.123456_abcd', 'image/jpeg'),
description: 'aa' * MediaAttachment::MAX_DESCRIPTION_LENGTH,
description: 'a' * MediaAttachment::MAX_DESCRIPTION_LENGTH * 2,
}
end