Merge pull request #2227 from scart88/main
Redirect back to account settings page when the user role is changed …
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user