From c96e0f9dab7407e40f7eb7c14fa964b788ccebe0 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 11 Dec 2025 12:24:54 -0500 Subject: [PATCH] Fix direct upload to use account-scoped endpoint The upstream Fizzy API (PR #2079) now requires the account slug in the direct upload path. Updated to use account_path() for the Active Storage direct uploads endpoint. Closes #5 --- lib/fizzy/client.rb | 2 +- test/fizzy/commands/upload_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fizzy/client.rb b/lib/fizzy/client.rb index 7ca0fb8..05061e6 100644 --- a/lib/fizzy/client.rb +++ b/lib/fizzy/client.rb @@ -71,7 +71,7 @@ def direct_upload(file_path) } } - upload_info = post("/rails/active_storage/direct_uploads", blob_params) + upload_info = post(account_path("/rails/active_storage/direct_uploads"), blob_params) raise Fizzy::Error, "Failed to create direct upload" unless upload_info && upload_info[:data] data = upload_info[:data] diff --git a/test/fizzy/commands/upload_test.rb b/test/fizzy/commands/upload_test.rb index 1ecf880..1b6eac2 100644 --- a/test/fizzy/commands/upload_test.rb +++ b/test/fizzy/commands/upload_test.rb @@ -36,7 +36,7 @@ def test_upload_file_requires_existing_file def test_upload_file_creates_direct_upload # Step 1: Create direct upload - stub_request(:post, "https://app.fizzy.do/rails/active_storage/direct_uploads") + stub_request(:post, "https://app.fizzy.do/test_account/rails/active_storage/direct_uploads") .to_return( status: 200, body: {