-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to HTTPoison dependency * Refactor tests to use HTTPoison
- Loading branch information
1 parent
270ff6d
commit c093ce7
Showing
9 changed files
with
103 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ defmodule SparkPostTest do | |
import Mock | ||
|
||
test "send succeeds with a Transmission.Response" do | ||
with_mock HTTPotion, [request: MockServer.mk_resp] do | ||
with_mock HTTPoison, [request: MockServer.mk_resp] do | ||
resp = SparkPost.send( | ||
to: "[email protected]", | ||
from: "[email protected]", | ||
|
@@ -19,7 +19,7 @@ defmodule SparkPostTest do | |
end | ||
|
||
test "send fails with a Endpoint.Error" do | ||
with_mock HTTPotion, [request: MockServer.mk_fail] do | ||
with_mock HTTPoison, [request: MockServer.mk_fail] do | ||
resp = SparkPost.send( | ||
to: "[email protected]", | ||
from: "[email protected]", | ||
|
@@ -37,16 +37,16 @@ defmodule SparkPostTest do | |
subject = "Elixir and SparkPost..." | ||
text = "Raw text email is boring" | ||
html = "<marquee>Rich text email is terrifying</marquee>" | ||
with_mock HTTPotion, [request: fn (method, url, opts) -> | ||
inreq = Poison.decode!(opts[:body], [keys: :atoms]) | ||
with_mock HTTPoison, [request: fn (method, url, body, headers, opts) -> | ||
inreq = Poison.decode!(body, [keys: :atoms]) | ||
assert Recipient.to_recipient_list(inreq.recipients) == Recipient.to_recipient_list(to) | ||
assert Content.to_content(inreq.content) == %Content.Inline{ | ||
from: Address.to_address(from), | ||
subject: subject, | ||
text: text, | ||
html: html | ||
} | ||
MockServer.mk_resp.(method, url, opts) | ||
MockServer.mk_resp.(method, url, body, headers, opts) | ||
end] do | ||
SparkPost.send( | ||
to: to, | ||
|
Oops, something went wrong.