Skip to content

Commit

Permalink
Return body in response of PostmarkAdapter.deliver
Browse files Browse the repository at this point in the history
In 10bd20e the `with_body` request option was accidentally removed from
`PostmarkAdapter.deliver/2`.

This change restores this option and adds a test to verify that the
textual body is returned instead of the reference.
  • Loading branch information
pablo-co authored Jun 7, 2017
1 parent 6a2aabd commit ac73a2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bamboo/postmark_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ defmodule Bamboo.PostmarkAdapter do
end

defp options(config) do
config[:request_options] || []
Keyword.merge(config[:request_options] || [], [with_body: true])
end
end
6 changes: 6 additions & 0 deletions test/lib/bamboo/postmark_adapter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ defmodule Bamboo.PostmarkAdapterTest do
end
end

test "deliver/2 returns the textual body of the request" do
response = PostmarkAdapter.deliver(new_email(), @config)

assert response.body == "SENT"
end

test "deliver/2 makes the request to the right url" do
new_email() |> PostmarkAdapter.deliver(@config)

Expand Down

0 comments on commit ac73a2b

Please sign in to comment.