Skip to content

Commit

Permalink
test custom_args
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Aug 7, 2018
1 parent bf8f192 commit 2195a60
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/lib/bamboo/adapters/send_grid_adapter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,29 @@ defmodule Bamboo.SendGridAdapterTest do
]
end

test "deliver/2 correctly custom args" do
email = new_email()

email
|> Email.put_private(:custom_args, %{post_code: "123"})
|> SendGridAdapter.deliver(@config)

assert_receive {:fake_sendgrid, %{params: params}}
personalization = List.first(params["personalizations"])
assert personalization["custom_args"] == %{"post_code" => "123"}
end

test "deliver/2 without custom args" do
email = new_email()

email
|> SendGridAdapter.deliver(@config)

assert_receive {:fake_sendgrid, %{params: params}}
personalization = List.first(params["personalizations"])
assert personalization["custom_args"] == nil
end

test "deliver/2 correctly formats recipients" do
email =
new_email(
Expand Down

0 comments on commit 2195a60

Please sign in to comment.