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
+2 -2
View File
@@ -7,7 +7,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
test "create" do
assert_changes -> { ActiveStorage::Attachment.count }, 1 do
post uploads_url(format: "json"), params: { file: fixture_file_upload("moon.jpg", "image/jpeg") }, as: :xhr
post uploads_path(format: "json"), params: { file: fixture_file_upload("moon.jpg", "image/jpeg") }, as: :xhr
end
assert_response :success
@@ -18,7 +18,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
test "show" do
accounts("37s").uploads.attach fixture_file_upload("moon.jpg", "image/jpeg")
get upload_url(slug: accounts("37s").uploads.last.slug)
get upload_path(slug: accounts("37s").uploads.last.slug)
assert_response :redirect
assert_match /\/rails\/active_storage\/.*\/moon\.jpg/, @response.redirect_url
end