Merge commit 'ad245adf510cf56953ebb8a7dfc5db16c0f58403' into glitch-soc/merge-upstream

Conflicts:
- `spec/controllers/application_controller_spec.rb`:
  Upstream changed some test cases, where glitch-soc had extra tests.
  Changed as upstream did while preserving glitch-soc's tests.
This commit is contained in:
Claire committed 2026-07-31 19:18:30 +02:00
commit 2ee260423f
70 files changed
+890 -218

No files matched your search

@@ -66,5 +66,30 @@ RSpec.describe 'API V1 Accounts FollowerAccounts' do
)
end
end
context 'when request account is permanently deleted' do
before do
account.mark_deleted!
account.deletion_request.destroy
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/followers", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
context 'when request account is pending deletion' do
before do
account.mark_deleted!
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/followers", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
end
end
@@ -66,5 +66,30 @@ RSpec.describe 'API V1 Accounts FollowingAccounts' do
)
end
end
context 'when request account is permanently deleted' do
before do
account.mark_deleted!
account.deletion_request.destroy
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/following", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
context 'when request account is pending deletion' do
before do
account.mark_deleted!
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/following", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
end
end
@@ -22,4 +22,29 @@ RSpec.describe 'Accounts Lists API' do
.to start_with('application/json')
end
end
context 'when requested account is permanently deleted' do
before do
account.mark_deleted!
account.deletion_request.destroy
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/lists", headers: headers
expect(response).to have_http_status(404)
end
end
context 'when requested account is pending deletion' do
before do
account.mark_deleted!
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/lists", headers: headers
expect(response).to have_http_status(404)
end
end
end
@@ -152,5 +152,34 @@ RSpec.describe 'API V1 Accounts Statuses' do
end
end
end
context 'when requested account is permanently deleted' do
let(:account) { Fabricate(:account) }
before do
account.mark_deleted!
account.deletion_request.destroy
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/statuses", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
context 'when requested account is pending deletion' do
let(:account) { Fabricate(:account) }
before do
account.mark_deleted!
end
it 'returns http not found' do
get "/api/v1/accounts/#{account.id}/statuses", params: { limit: 2 }, headers: headers
expect(response).to have_http_status(404)
end
end
end
end
+25
View File
@@ -48,6 +48,31 @@ RSpec.describe '/api/v1/accounts' do
end
end
context 'when requesting a permanently deleted account' do
let(:other_account) { Fabricate(:account, requested_deletion: true) }
before do
get "/api/v1/accounts/#{other_account.id}"
end
it 'returns http not found' do
expect(response).to have_http_status(404)
end
end
context 'when requesting an account pending deletion' do
let(:other_account) { Fabricate(:account) }
before do
other_account.mark_deleted!
get "/api/v1/accounts/#{other_account.id}"
end
it 'returns http not found' do
expect(response).to have_http_status(404)
end
end
context 'when logged in' do
subject do
get "/api/v1/accounts/#{account.id}", headers: headers