Skip to content

Commit

Permalink
Bumped version to 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ekaputra07 committed Oct 28, 2024
1 parent 39a614d commit fceb63f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Api2pdf.MixProject do
def project do
[
app: :api2pdf,
version: "0.2.0",
version: "0.2.1",
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
package: package(),
Expand Down
13 changes: 12 additions & 1 deletion test/api2pdf_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Api2pdfTest do
doctest Api2pdf

describe "make_post_request/3" do
test "it success" do
test "it success (Error == nil)" do
expect(ClientMock, :post_request, fn url, payload, opts ->
assert url == "/test"
assert payload == %{}
Expand All @@ -17,6 +17,17 @@ defmodule Api2pdfTest do
assert {:ok, _} = Api2pdf.make_post_request("/test", %{}, tag: "test")
end

test "it success (no Error, but FileUrl present)" do
expect(ClientMock, :post_request, fn url, payload, opts ->
assert url == "/test"
assert payload == %{}
assert opts == [tag: "test"]
%{body: %{"FileUrl" => "test"}}
end)

assert {:ok, _} = Api2pdf.make_post_request("/test", %{}, tag: "test")
end

test "it failed (connection error)" do
expect(ClientMock, :post_request, fn _, _, _ ->
{:error, :timeout}
Expand Down

0 comments on commit fceb63f

Please sign in to comment.