mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-24 02:51:43 +01:00
Use expect
for nested params in auth/setup#update
(#33657)
This commit is contained in:
parent
7543c90642
commit
45149cd5e1
@ -35,6 +35,6 @@ class Auth::SetupController < ApplicationController
|
||||
end
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:email)
|
||||
params.expect(user: [:email])
|
||||
end
|
||||
end
|
||||
|
@ -24,4 +24,15 @@ RSpec.describe 'Auth Setup' do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'PUT /auth/setup' do
|
||||
before { sign_in Fabricate(:user, confirmed_at: nil) }
|
||||
|
||||
it 'gracefully handles invalid nested params' do
|
||||
put '/auth/setup?user=invalid'
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(400)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user