users: fix name changes not being validated.

Fix names not being validated when a user changes their name. Regression in 5ce724f1e.
This commit is contained in:
evazion
2022-03-09 00:20:18 -06:00
parent d770f0bb95
commit 80939f5e22
3 changed files with 12 additions and 6 deletions

View File

@@ -28,6 +28,14 @@ class UserNameChangeRequestsControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to profile_path
assert_equal("zun", @user.reload.name)
end
should "fail if the new name is invalid" do
assert_no_changes(-> { @user.reload.name }) do
post_auth user_name_change_requests_path, @user, params: { user_name_change_request: { desired_name: "foo__bar" }}
assert_response :success
end
end
end
context "show action" do