Skip to content

Commit

Permalink
Migration to API v3.2 - fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushar Madhukar committed Jun 19, 2018
1 parent c58d528 commit afb3553
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/createsend/subscriber.rb
Expand Up @@ -38,7 +38,7 @@ def self.add(auth, list_id, email_address, name, custom_fields, resubscribe,
end

# Imports subscribers into a subscriber list.
def self.import(auth, list_id, subscribers, resubscribe,
def self.import(auth, list_id, subscribers, resubscribe,
queue_subscription_based_autoresponders=false,
restart_subscription_based_autoresponders=false)
options = { :body => {
Expand Down
12 changes: 6 additions & 6 deletions test/subscriber_test.rb
Expand Up @@ -77,7 +77,7 @@ class SubscriberTest < Test::Unit::TestCase
{ :EmailAddress => "example+2@example.com", :Name => "Example Two" },
{ :EmailAddress => "example+3@example.com", :Name => "Example Three" },
]
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, "No"
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true
import_result.FailureDetails.size.should == 0
import_result.TotalUniqueEmailsSubmitted.should == 3
import_result.TotalExistingSubscribers.should == 0
Expand All @@ -92,7 +92,7 @@ class SubscriberTest < Test::Unit::TestCase
{ :EmailAddress => "example+2@example.com", :Name => "Example Two" },
{ :EmailAddress => "example+3@example.com", :Name => "Example Three" },
]
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, "No", true
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, true
import_result.FailureDetails.size.should == 0
import_result.TotalUniqueEmailsSubmitted.should == 3
import_result.TotalExistingSubscribers.should == 0
Expand All @@ -107,7 +107,7 @@ class SubscriberTest < Test::Unit::TestCase
{ :EmailAddress => "example+2@example.com", :Name => "Example Two", :CustomFields => [ { :Key => 'website', :Value => '', :Clear => false } ] },
{ :EmailAddress => "example+3@example.com", :Name => "Example Three", :CustomFields => [ { :Key => 'website', :Value => '', :Clear => false } ] },
]
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, "No"
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true
import_result.FailureDetails.size.should == 0
import_result.TotalUniqueEmailsSubmitted.should == 3
import_result.TotalExistingSubscribers.should == 0
Expand All @@ -123,7 +123,7 @@ class SubscriberTest < Test::Unit::TestCase
{ :EmailAddress => "example+2@example.com", :Name => "Example Two" },
{ :EmailAddress => "example+3@example.com", :Name => "Example Three" },
]
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, "No"
import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true
import_result.FailureDetails.size.should == 1
import_result.FailureDetails.first.EmailAddress.should == "example+1@example"
import_result.FailureDetails.first.Code.should == 1
Expand All @@ -142,8 +142,8 @@ class SubscriberTest < Test::Unit::TestCase
{ :EmailAddress => "example+2@example.com", :Name => "Example Two" },
{ :EmailAddress => "example+3@example.com", :Name => "Example Three" },
]
lambda { import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers, true, "Yes"
}.should raise_error(CreateSend::BadRequest)
lambda { import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers,
true }.should raise_error(CreateSend::BadRequest)
end

should "unsubscribe a subscriber" do
Expand Down

0 comments on commit afb3553

Please sign in to comment.