Merge commit '3178acc5cb8415a72b646dbe77be05255d3966f3' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2025-01-23 13:38:23 +01:00
commit 19fa4cfcf2
143 files changed
+741 -1289

No files matched your search

@@ -107,6 +107,13 @@ RSpec.describe 'API V1 Push Subscriptions' do
it_behaves_like 'validation error'
end
it 'gracefully handles invalid nested params' do
post api_v1_push_subscription_path, params: { subscription: 'invalid' }, headers: headers
expect(response)
.to have_http_status(400)
end
end
describe 'PUT /api/v1/push/subscription' do
@@ -133,6 +140,13 @@ RSpec.describe 'API V1 Push Subscriptions' do
policy: alerts_payload[:data][:policy]
)
end
it 'gracefully handles invalid nested params' do
put api_v1_push_subscription_path(endpoint_push_subscription), params: { data: 'invalid' }, headers: headers
expect(response)
.to have_http_status(400)
end
end
describe 'GET /api/v1/push/subscription' do
@@ -52,4 +52,28 @@ RSpec.describe 'API Web Push Subscriptions' do
end
end
end
describe 'POST /api/web/push_subscriptions' do
before { sign_in Fabricate :user }
it 'gracefully handles invalid nested params' do
post api_web_push_subscriptions_path, params: { subscription: 'invalid' }
expect(response)
.to have_http_status(400)
end
end
describe 'PUT /api/web/push_subscriptions' do
before { sign_in Fabricate :user }
let(:subscription) { Fabricate :web_push_subscription }
it 'gracefully handles invalid nested params' do
put api_web_push_subscription_path(subscription), params: { data: 'invalid' }
expect(response)
.to have_http_status(400)
end
end
end
+18
View File
@@ -0,0 +1,18 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Disputes Appeals' do
describe 'POST /disputes/appeals' do
before { sign_in strike.target_account.user }
let(:strike) { Fabricate :account_warning }
it 'gracefully handles invalid nested params' do
post disputes_strike_appeal_path(strike, appeal: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+24
View File
@@ -13,4 +13,28 @@ RSpec.describe 'Filters' do
end
end
end
describe 'POST /filters' do
before { sign_in Fabricate :user }
it 'gracefully handles invalid nested params' do
post filters_path(custom_filter: 'invalid')
expect(response)
.to have_http_status(400)
end
end
describe 'PUT /filters/:id' do
before { sign_in(filter.account.user) }
let(:filter) { Fabricate :custom_filter }
it 'gracefully handles invalid nested params' do
put filter_path(filter, custom_filter: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+9
View File
@@ -28,4 +28,13 @@ RSpec.describe 'Invites' do
end
end
end
describe 'POST /invites' do
it 'gracefully handles invalid nested params' do
post invites_path(invite: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Aliases' do
describe 'POST /settings/aliases' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
post settings_aliases_path(account_alias: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Deletes' do
describe 'DELETE /settings/delete' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
delete settings_delete_path(form_delete_confirmation: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Aliases' do
describe 'POST /settings/featured_tags' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
post settings_featured_tags_path(featured_tag: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Imports' do
describe 'POST /settings/imports' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
post settings_imports_path(form_import: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Migration Redirects' do
describe 'POST /settings/migration/redirect' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
post settings_migration_redirect_path(form_redirect: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+11
View File
@@ -18,4 +18,15 @@ RSpec.describe 'Settings Migrations' do
it { is_expected.to redirect_to new_user_session_path }
end
end
context 'when user is signed in' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
post settings_migration_path(account_migration: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Privacy' do
describe 'PUT /settings/privacy' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
put settings_privacy_path(account: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Settings Profiles' do
describe 'PUT /settings/profile' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
put settings_profile_path(account: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end
+16
View File
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Statuses Cleanup' do
describe 'PUT /statuses_cleanup' do
before { sign_in Fabricate(:user) }
it 'gracefully handles invalid nested params' do
put statuses_cleanup_path(account_statuses_cleanup_policy: 'invalid')
expect(response)
.to have_http_status(400)
end
end
end