Use _path in all cases where we are not potentially changing the domain

This commit is contained in:
David Heinemeier Hansson
2025-04-13 08:17:36 +02:00
parent 7b60748796
commit dbf61f4fc3
28 changed files with 82 additions and 82 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test "destroy" do
assert_difference -> { User.active.count }, -1 do
delete user_url(users(:david))
delete user_path(users(:david))
end
assert_redirected_to users_path
@@ -21,10 +21,10 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test "non-admins cannot perform actions" do
sign_in_as :jz
put user_url(users(:david)), params: { user: { role: "admin" } }
put user_path(users(:david)), params: { user: { role: "admin" } }
assert_response :forbidden
delete user_url(users(:david))
delete user_path(users(:david))
assert_response :forbidden
end
end