Skip to content

Commit

Permalink
Changes assert email timeout to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
jbernardo95 committed Dec 8, 2016
1 parent 984ca76 commit e0b5a55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/bamboo/test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ defmodule Bamboo.Test do
Checks whether an email was delivered.
Must be used with the `Bamboo.TestAdapter` or this will never pass. In case you
are delivering from another process, the assertion waits up to 150ms before
are delivering from another process, the assertion waits up to 100ms before
failing. Typically if an email is successfully delivered the assertion will
pass instantly, so test suites will remain fast.
Expand All @@ -161,15 +161,15 @@ defmodule Bamboo.Test do
quote do
import ExUnit.Assertions
email = Bamboo.Test.normalize_for_testing(unquote(email))
assert_receive({:delivered_email, ^email}, 150, Bamboo.Test.flunk_with_email_list(email))
assert_receive({:delivered_email, ^email}, 100, Bamboo.Test.flunk_with_email_list(email))
end
end

@doc """
Checks whether an email its params equal to the ones provided.
Must be used with the `Bamboo.TestAdapter` or this will never pass. In case you
are delivering from another process, the assertion waits up to 150ms before
are delivering from another process, the assertion waits up to 100ms before
failing. Typically if an email is successfully delivered the assertion will
pass instantly, so test suites will remain fast.
Expand All @@ -185,7 +185,7 @@ defmodule Bamboo.Test do
defmacro assert_delivered_with(email_params) do
quote bind_quoted: [email_params: email_params] do
import ExUnit.Assertions
assert_receive({:delivered_email, email}, 150, Bamboo.Test.flunk_no_emails_received)
assert_receive({:delivered_email, email}, 100, Bamboo.Test.flunk_no_emails_received)

recieved_email_params = email |> Map.from_struct
assert Enum.all?(email_params, fn({k, v}) -> recieved_email_params[k] == v end),
Expand Down

0 comments on commit e0b5a55

Please sign in to comment.