-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(legacy-api): allow _expansions to be provided as true to return a…
…ll expansions closes #2932
- Loading branch information
Showing
2 changed files
with
52 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,49 @@ | |
end | ||
end | ||
|
||
context "when all expansions are requested" do | ||
let(:expansions) { true } | ||
|
||
it "returns details about the message" do | ||
expect(response.status).to eq 200 | ||
parsed_body = JSON.parse(response.body) | ||
expect(parsed_body["status"]).to eq "success" | ||
expect(parsed_body["data"]).to match({ | ||
"id" => message.id, | ||
"token" => message.token, | ||
"status" => { "held" => false, | ||
"hold_expiry" => nil, | ||
"last_delivery_attempt" => nil, | ||
"status" => "Pending" }, | ||
"details" => { "bounce" => false, | ||
"bounce_for_id" => 0, | ||
"direction" => "outgoing", | ||
"mail_from" => "[email protected]", | ||
"message_id" => message.message_id, | ||
"rcpt_to" => "[email protected]", | ||
"received_with_ssl" => nil, | ||
"size" => kind_of(String), | ||
"subject" => "An example message", | ||
"tag" => nil, | ||
"timestamp" => kind_of(Float) }, | ||
"inspection" => { "inspected" => false, | ||
"spam" => false, | ||
"spam_score" => 0.0, | ||
"threat" => false, | ||
"threat_details" => nil }, | ||
"plain_body" => message.plain_body, | ||
"html_body" => message.html_body, | ||
"attachments" => [], | ||
"headers" => message.headers, | ||
"raw_message" => Base64.encode64(message.raw_message), | ||
"activity_entries" => { | ||
"loads" => [], | ||
"clicks" => [] | ||
} | ||
}) | ||
end | ||
end | ||
|
||
context "when the status expansion is requested" do | ||
let(:expansions) { ["status"] } | ||
|
||
|