test/campaign_test.rb in createsend-5.0.0 vs test/campaign_test.rb in createsend-5.1.0
- old
+ new
@@ -189,11 +189,11 @@
res.Results.first.ListID.should == "a994a3caf1328a16af9a69a730eaa706"
end
should "get the opens for a campaign" do
min_date = "2010-01-01"
- stub_get(@auth, "campaigns/#{@campaign.campaign_id}/opens.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_opens.json")
+ stub_get(@auth, "campaigns/#{@campaign.campaign_id}/opens.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{ERB::Util.url_encode(min_date)}", "campaign_opens.json")
opens = @campaign.opens min_date
opens.Results.size.should == 5
opens.Results.first.EmailAddress.should == "subs+6576576576@example.com"
opens.Results.first.ListID.should == "512a3bc577a58fdf689c654329b50fa0"
opens.Results.first.Date.should == "2010-10-11 08:29:00"
@@ -213,11 +213,11 @@
opens.NumberOfPages.should == 1
end
should "get the subscriber clicks for a campaign" do
min_date = "2010-01-01"
- stub_get(@auth, "campaigns/#{@campaign.campaign_id}/clicks.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_clicks.json")
+ stub_get(@auth, "campaigns/#{@campaign.campaign_id}/clicks.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{ERB::Util.url_encode(min_date)}", "campaign_clicks.json")
clicks = @campaign.clicks min_date
clicks.Results.size.should == 3
clicks.Results.first.EmailAddress.should == "subs+6576576576@example.com"
clicks.Results.first.URL.should == "http://video.google.com.au/?hl=en&tab=wv"
clicks.Results.first.ListID.should == "512a3bc577a58fdf689c654329b50fa0"
@@ -238,11 +238,11 @@
clicks.NumberOfPages.should == 1
end
should "get the unsubscribes for a campaign" do
min_date = "2010-01-01"
- stub_get(@auth, "campaigns/#{@campaign.campaign_id}/unsubscribes.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_unsubscribes.json")
+ stub_get(@auth, "campaigns/#{@campaign.campaign_id}/unsubscribes.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{ERB::Util.url_encode(min_date)}", "campaign_unsubscribes.json")
unsubscribes = @campaign.unsubscribes min_date
unsubscribes.Results.size.should == 1
unsubscribes.Results.first.EmailAddress.should == "subs+6576576576@example.com"
unsubscribes.Results.first.ListID.should == "512a3bc577a58fdf689c654329b50fa0"
unsubscribes.Results.first.Date.should == "2010-10-11 08:29:00"
@@ -256,11 +256,11 @@
unsubscribes.NumberOfPages.should == 1
end
should "get the spam complaints for a campaign" do
min_date = "2010-01-01"
- stub_get(@auth, "campaigns/#{@campaign.campaign_id}/spam.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_spam.json")
+ stub_get(@auth, "campaigns/#{@campaign.campaign_id}/spam.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{ERB::Util.url_encode(min_date)}", "campaign_spam.json")
spam = @campaign.spam min_date
spam.Results.size.should == 1
spam.Results.first.EmailAddress.should == "subs+6576576576@example.com"
spam.Results.first.ListID.should == "512a3bc577a58fdf689c654329b50fa0"
spam.Results.first.Date.should == "2010-10-11 08:29:00"
@@ -273,10 +273,10 @@
spam.NumberOfPages.should == 1
end
should "get the bounces for a campaign" do
min_date = "2010-01-01"
- stub_get(@auth, "campaigns/#{@campaign.campaign_id}/bounces.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{CGI.escape(min_date)}", "campaign_bounces.json")
+ stub_get(@auth, "campaigns/#{@campaign.campaign_id}/bounces.json?page=1&pagesize=1000&orderfield=date&orderdirection=asc&date=#{ERB::Util.url_encode(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"
\ No newline at end of file