test/campaign_test.rb in createsend-0.3.0 vs test/campaign_test.rb in createsend-0.3.1
- old
+ new
@@ -39,11 +39,11 @@
summary.TotalOpened.should == 10
summary.Clicks.should == 0
summary.Unsubscribed.should == 0
summary.Bounced.should == 0
summary.UniqueOpened.should == 5
- summary.WebVersionURL.should == "http://clientone.createsend.com/t/ViewEmail/r/3A433FC72FFE3B8B/C67FD2F38AC4859C/"
+ summary.WebVersionURL.should == "http://createsend.com/t/r-3A433FC72FFE3B8B"
end
should "get the lists and segments for a campaign" do
stub_get(@api_key, "campaigns/#{@campaign.campaign_id}/listsandsegments.json", "campaign_listsandsegments.json")
ls = @campaign.lists_and_segments
@@ -125,11 +125,12 @@
unsubscribes.TotalNumberOfRecords.should == 1
unsubscribes.NumberOfPages.should == 1
end
should "get the bounces for a campaign" do
- stub_get(@api_key, "campaigns/#{@campaign.campaign_id}/bounces.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc", "campaign_bounces.json")
- bounces = @campaign.bounces
+ min_date = "2010-01-01"
+ stub_get(@api_key, "campaigns/#{@campaign.campaign_id}/bounces.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_bounces.json")
+ bounces = @campaign.bounces min_date
bounces.Results.size.should == 2
bounces.Results.first.EmailAddress.should == "asdf@softbouncemyemail.com"
bounces.Results.first.ListID.should == "654523a5855b4a440bae3fb295641546"
bounces.Results.first.BounceType.should == "Soft"
bounces.Results.first.Date.should == "2010-07-02 16:46:00"
\ No newline at end of file