Merge pull request #2227 from scart88/main

Redirect back to account settings page when the user role is changed …
This commit is contained in:
Jorge Manrubia
2026-01-07 16:27:05 +01:00
committed by GitHub
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ class Users::RolesController < ApplicationController
def update
@user.update!(role_params)
redirect_to users_path
redirect_to account_settings_path
end
private
+1 -1
View File
@@ -30,7 +30,7 @@ class UsersController < ApplicationController
@user.deactivate
respond_to do |format|
format.html { redirect_to users_path }
format.html { redirect_to account_settings_path }
format.json { head :no_content }
end
end
@@ -10,7 +10,7 @@ class Users::RolesControllerTest < ActionDispatch::IntegrationTest
put user_role_path(users(:david)), params: { user: { role: "admin" } }
assert_redirected_to users_path
assert_redirected_to account_settings_path
assert users(:david).reload.admin?
end
+1 -1
View File
@@ -37,7 +37,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
delete user_path(users(:david))
end
assert_redirected_to users_path
assert_redirected_to account_settings_path
assert_nil User.active.find_by(id: users(:david).id)
end