Skip to content

Commit

Permalink
Fix Chouette Valid client (#4121)
Browse files Browse the repository at this point in the history
The multipart upload was buggy.
  • Loading branch information
ptitfred authored Aug 8, 2024
1 parent 63a5e48 commit f825336
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule Transport.EnRouteChouetteValidClient do
end

defp make_file_part(field_name, filepath) do
{field_name, filepath, {"form-data", [{:name, "file"}, {:filename, Path.basename(filepath)}]}, []}
{:file, filepath, {"form-data", [{:name, field_name}, {:filename, Path.basename(filepath)}]}, []}
end

defp validation_url(validation_id) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ defmodule Transport.EnRouteChouetteValidClientTest do

assert [
{"validation[rule_set]", "french"},
{"validation[file]", tmp_file, {"form-data", [{:name, "file"}, {:filename, Path.basename(tmp_file)}]},
[]}
{:file, tmp_file, {"form-data", [{:name, "validation[file]"}, {:filename, Path.basename(tmp_file)}]}, []}
] == parts

%HTTPoison.Response{status_code: 201, body: response_body}
Expand Down

0 comments on commit f825336

Please sign in to comment.