-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "invalid data format/type" error
- Loading branch information
1 parent
b318bb7
commit 98e7c25
Showing
4 changed files
with
15 additions
and
15 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 |
---|---|---|
|
@@ -71,7 +71,7 @@ | |
a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
|
||
it "handles name and email" do | ||
|
@@ -82,7 +82,7 @@ | |
a_hash_including({address: {email: "[email protected]", name: "Sam Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", name: "Brock Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
|
||
it "handles mix of email only and name/email" do | ||
|
@@ -95,7 +95,7 @@ | |
{address: {email: "[email protected]", name: "Chris Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", name: "Brock Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
end | ||
end | ||
|
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
|
||
it "handles name and email" do | ||
|
@@ -23,7 +23,7 @@ | |
|
||
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", name: "Joe Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
end | ||
|
||
|
@@ -35,7 +35,7 @@ | |
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
|
||
it "handles name and email" do | ||
|
@@ -45,7 +45,7 @@ | |
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", name: "Joe Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", name: "Chris Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
|
||
it "handles mix of email only and name/email" do | ||
|
@@ -55,7 +55,7 @@ | |
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", name: "Joe Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
end | ||
|
||
|
@@ -67,7 +67,7 @@ | |
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
|
||
it "handles name and email" do | ||
|
@@ -77,7 +77,7 @@ | |
expect(@delivery_method.data[:recipients]).to match([a_hash_including({address: {email: "[email protected]", name: "Joe Test", header_to: anything}}), | ||
a_hash_including({address: {email: "[email protected]", name: "Sam Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]"}) | ||
end | ||
end | ||
|
||
|
@@ -90,7 +90,7 @@ | |
a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
|
||
it "handles name and email" do | ||
|
@@ -101,7 +101,7 @@ | |
a_hash_including({address: {email: "[email protected]", name: "Sam Test", header_to: anything}}), | ||
{address: {email: "[email protected]", name: "Carl Test", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", name: "Chris Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
|
||
it "handles mix of email only and name/email for to recipients" do | ||
|
@@ -112,7 +112,7 @@ | |
a_hash_including({address: {email: "[email protected]", header_to: anything}}), | ||
{address: {email: "[email protected]", header_to: "[email protected]"}}, | ||
{address: {email: "[email protected]", name: "Chris Test", header_to: "[email protected]"}}]) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]", "[email protected]"]}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected],[email protected]"}) | ||
end | ||
end | ||
end | ||
|
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
test_email = Mailer.test_email cc: "Carl Test <[email protected]>", headers: {"Priority" => "urgent", "Sensitivity" => "private"} | ||
@delivery_method.deliver!(test_email) | ||
|
||
expect(@delivery_method.data[:content][:headers]).to eq({cc: ["[email protected]"], "Priority" => "urgent", "Sensitivity" => "private"}) | ||
expect(@delivery_method.data[:content][:headers]).to eq({cc: "[email protected]", "Priority" => "urgent", "Sensitivity" => "private"}) | ||
end | ||
|
||
it "does not pass inappropriate headers through to the API" do | ||
|