-
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.
add ip_pool option for config and message, fixed transactional_spec
- Loading branch information
1 parent
69525b5
commit 371b479
Showing
5 changed files
with
69 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require 'spec_helper' | ||
|
||
describe SparkPostRails::DeliveryMethod do | ||
|
||
before(:each) do | ||
SparkPostRails.configuration.set_defaults | ||
@delivery_method = SparkPostRails::DeliveryMethod.new | ||
end | ||
|
||
context "IP Pool" do | ||
it "handles ip_pool set in the configuration" do | ||
SparkPostRails.configure do |c| | ||
c.ip_pool = "default_ip" | ||
end | ||
|
||
test_email = Mailer.test_email | ||
@delivery_method.deliver!(test_email) | ||
|
||
expect(@delivery_method.data[:options][:ip_pool]).to eq("default_ip") | ||
end | ||
|
||
it "handles ip_pool set on an individual message" do | ||
test_email = Mailer.test_email sparkpost_data: {ip_pool: "message_ip"} | ||
|
||
@delivery_method.deliver!(test_email) | ||
|
||
expect(@delivery_method.data[:options][:ip_pool]).to eq("message_ip") | ||
end | ||
|
||
it "handles the value on an individual message overriding configuration" do | ||
SparkPostRails.configure do |c| | ||
c.ip_pool = "default_ip" | ||
end | ||
|
||
test_email = Mailer.test_email sparkpost_data: {ip_pool: "message_ip"} | ||
|
||
@delivery_method.deliver!(test_email) | ||
|
||
expect(@delivery_method.data[:options][:ip_pool]).to eq("message_ip") | ||
end | ||
|
||
it "handles a default setting of none" do | ||
test_email = Mailer.test_email | ||
@delivery_method.deliver!(test_email) | ||
|
||
expect(@delivery_method.data[:options].has_key?(:ip_pool)).to eq(false) | ||
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
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