Use _path in all cases where we are not potentially changing the domain
This commit is contained in:
@@ -8,7 +8,7 @@ class Users::RolesControllerTest < ActionDispatch::IntegrationTest
|
||||
test "update" do
|
||||
assert_not users(:david).admin?
|
||||
|
||||
put user_role_url(users(:david)), params: { user: { role: "admin" } }
|
||||
put user_role_path(users(:david)), params: { user: { role: "admin" } }
|
||||
|
||||
assert_redirected_to users_path
|
||||
assert users(:david).reload.admin?
|
||||
@@ -16,7 +16,7 @@ class Users::RolesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "can't promote to special roles" do
|
||||
assert_no_changes -> { users(:david).reload.role } do
|
||||
put user_role_url(users(:david)), params: { user: { role: "system" } }
|
||||
put user_role_path(users(:david)), params: { user: { role: "system" } }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user