createsend 5.1.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +30 -0
- data/README.md +2 -2
- data/createsend.gemspec +1 -1
- data/lib/createsend/client.rb +19 -3
- data/lib/createsend/createsend.rb +1 -1
- data/lib/createsend/list.rb +13 -12
- data/lib/createsend/subscriber.rb +8 -4
- data/lib/createsend/version.rb +1 -1
- data/samples/authentication_sample.rb +64 -0
- data/samples/clients_sample.rb +79 -0
- data/samples/journey_sample.rb +3 -2
- data/samples/lists_sample.rb +51 -0
- data/samples/segments_sample.rb +21 -0
- data/samples/subscribers_sample.rb +51 -0
- data/test/administrator_test.rb +5 -5
- data/test/campaign_test.rb +114 -113
- data/test/client_test.rb +121 -98
- data/test/createsend_test.rb +47 -47
- data/test/fixtures/active_subscribers.json +5 -0
- data/test/fixtures/bounced_subscribers.json +1 -0
- data/test/fixtures/campaign_summary.json +2 -1
- data/test/fixtures/campaigns.json +37 -26
- data/test/fixtures/deleted_subscribers.json +5 -0
- data/test/fixtures/drafts.json +4 -2
- data/test/fixtures/scheduled_campaigns.json +4 -2
- data/test/fixtures/segment_subscribers.json +2 -0
- data/test/fixtures/subscriber_details.json +2 -0
- data/test/fixtures/{subscriber_details_with_track_pref.json → subscriber_details_with_track_and_sms_pref.json} +4 -1
- data/test/fixtures/tags.json +10 -0
- data/test/fixtures/unconfirmed_subscribers.json +6 -2
- data/test/fixtures/unsubscribed_subscribers.json +6 -1
- data/test/helper.rb +1 -1
- data/test/journey_test.rb +86 -86
- data/test/list_test.rb +130 -123
- data/test/person_test.rb +6 -6
- data/test/segment_test.rb +23 -22
- data/test/subscriber_test.rb +55 -51
- data/test/template_test.rb +5 -5
- data/test/transactional_classic_email_test.rb +6 -6
- data/test/transactional_smart_email_test.rb +19 -19
- data/test/transactional_timeline_test.rb +25 -25
- metadata +16 -113
@@ -4,6 +4,7 @@
|
|
4
4
|
"EmailAddress": "subs+7t8787Y@example.com",
|
5
5
|
"Name": "Person One",
|
6
6
|
"Date": "2010-10-25 10:28:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 10:28:00",
|
7
8
|
"State": "Active",
|
8
9
|
"CustomFields": [
|
9
10
|
{
|
@@ -33,6 +34,7 @@
|
|
33
34
|
"EmailAddress": "subs+7878787y8ggg@example.com",
|
34
35
|
"Name": "Person Two",
|
35
36
|
"Date": "2010-10-25 12:17:00",
|
37
|
+
"ListJoinedDate": "2010-10-25 12:17:00",
|
36
38
|
"State": "Active",
|
37
39
|
"CustomFields": [
|
38
40
|
{
|
@@ -46,6 +48,7 @@
|
|
46
48
|
"EmailAddress": "subs+7890909i0ggg@example.com",
|
47
49
|
"Name": "Person Three",
|
48
50
|
"Date": "2010-10-25 12:52:00",
|
51
|
+
"ListJoinedDate": "2010-10-25 12:52:00",
|
49
52
|
"State": "Active",
|
50
53
|
"CustomFields": [
|
51
54
|
{
|
@@ -59,6 +62,7 @@
|
|
59
62
|
"EmailAddress": "subs@example.com",
|
60
63
|
"Name": "Person Four",
|
61
64
|
"Date": "2010-10-27 13:13:00",
|
65
|
+
"ListJoinedDate": "2010-10-27 13:13:00",
|
62
66
|
"State": "Active",
|
63
67
|
"CustomFields": [],
|
64
68
|
"ReadsEmailWith": ""
|
@@ -67,6 +71,7 @@
|
|
67
71
|
"EmailAddress": "joey@example.com",
|
68
72
|
"Name": "Person Five",
|
69
73
|
"Date": "2010-10-27 13:13:00",
|
74
|
+
"ListJoinedDate": "2010-10-27 13:13:00",
|
70
75
|
"State": "Active",
|
71
76
|
"CustomFields": [],
|
72
77
|
"ReadsEmailWith": "Gmail"
|
@@ -11,5 +11,6 @@
|
|
11
11
|
"WebVersionURL": "http://createsend.com/t/r-3A433FC72FFE3B8B",
|
12
12
|
"WebVersionTextURL": "http://createsend.com/t/r-3A433FC72FFE3B8B/t",
|
13
13
|
"WorldviewURL": "http://client.createsend.com/reports/wv/r/3A433FC72FFE3B8B",
|
14
|
-
"SpamComplaints": 23
|
14
|
+
"SpamComplaints": 23,
|
15
|
+
"Name": "Campaign Name"
|
15
16
|
}
|
@@ -1,26 +1,37 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"WebVersionURL": "http://createsend.com/t/r-765E86829575EE2C",
|
5
|
+
"WebVersionTextURL": "http://createsend.com/t/r-765E86829575EE2C/t",
|
6
|
+
"CampaignID": "fc0ce7105baeaf97f47c99be31d02a91",
|
7
|
+
"Subject": "Campaign One",
|
8
|
+
"Name": "Campaign One",
|
9
|
+
"FromName": "My Name",
|
10
|
+
"FromEmail": "myemail@example.com",
|
11
|
+
"ReplyTo": "myemail@example.com",
|
12
|
+
"SentDate": "2010-10-12 12:58:00",
|
13
|
+
"TotalRecipients": 2245,
|
14
|
+
"Tags": []
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"WebVersionURL": "http://createsend.com/t/r-DD543566A87C9B8B",
|
18
|
+
"WebVersionTextURL": "http://createsend.com/t/r-DD543566A87C9B8B/t",
|
19
|
+
"CampaignID": "072472b88c853ae5dedaeaf549a8d607",
|
20
|
+
"Subject": "Campaign Two",
|
21
|
+
"Name": "Campaign Two",
|
22
|
+
"FromName": "My Name",
|
23
|
+
"FromEmail": "myemail@example.com",
|
24
|
+
"ReplyTo": "myemail@example.com",
|
25
|
+
"SentDate": "2010-10-06 16:20:00",
|
26
|
+
"TotalRecipients": 11222,
|
27
|
+
"Tags": ["tagexample"]
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"ResultsOrderedBy": "sentdate",
|
31
|
+
"OrderDirection": "desc",
|
32
|
+
"PageNumber": 1,
|
33
|
+
"PageSize": 1000,
|
34
|
+
"RecordsOnThisPage": 2,
|
35
|
+
"TotalNumberOfRecords": 2,
|
36
|
+
"NumberOfPages": 1
|
37
|
+
}
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"EmailAddress": "subscriber@example.com",
|
5
5
|
"Name": "Deleted One",
|
6
6
|
"Date": "2010-10-25 13:11:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 13:11:00",
|
7
8
|
"State": "Deleted",
|
8
9
|
"CustomFields": [],
|
9
10
|
"ReadsEmailWith": "Gmail"
|
@@ -12,6 +13,7 @@
|
|
12
13
|
"EmailAddress": "subscriberone@example.com",
|
13
14
|
"Name": "Subscriber",
|
14
15
|
"Date": "2010-10-25 13:04:00",
|
16
|
+
"ListJoinedDate": "2010-10-25 13:04:00",
|
15
17
|
"State": "Deleted",
|
16
18
|
"CustomFields": [
|
17
19
|
{
|
@@ -25,6 +27,7 @@
|
|
25
27
|
"EmailAddress": "example+1@example.com",
|
26
28
|
"Name": "Example One",
|
27
29
|
"Date": "2010-10-26 10:56:00",
|
30
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
28
31
|
"State": "Deleted",
|
29
32
|
"CustomFields": [],
|
30
33
|
"ReadsEmailWith": ""
|
@@ -33,6 +36,7 @@
|
|
33
36
|
"EmailAddress": "example+2@example.com",
|
34
37
|
"Name": "Example Two",
|
35
38
|
"Date": "2010-10-26 10:56:00",
|
39
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
36
40
|
"State": "Deleted",
|
37
41
|
"CustomFields": [],
|
38
42
|
"ReadsEmailWith": ""
|
@@ -41,6 +45,7 @@
|
|
41
45
|
"EmailAddress": "example+3@example.com",
|
42
46
|
"Name": "Example Three",
|
43
47
|
"Date": "2010-10-26 10:56:00",
|
48
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
44
49
|
"State": "Deleted",
|
45
50
|
"CustomFields": [],
|
46
51
|
"ReadsEmailWith": "Gmail"
|
data/test/fixtures/drafts.json
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
"ReplyTo": "myemail@example.com",
|
9
9
|
"DateCreated": "2010-08-19 16:08:00",
|
10
10
|
"PreviewURL": "http://createsend.com/t/r-E97A7BB2E6983DA1",
|
11
|
-
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t"
|
11
|
+
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t",
|
12
|
+
"Tags": ["tagexample"]
|
12
13
|
},
|
13
14
|
{
|
14
15
|
"CampaignID": "2e928e982065d92627139208c8c01db1",
|
@@ -19,6 +20,7 @@
|
|
19
20
|
"ReplyTo": "myemail@example.com",
|
20
21
|
"DateCreated": "2010-08-19 16:08:00",
|
21
22
|
"PreviewURL": "http://createsend.com/t/r-E97A7BB2E6983DA1",
|
22
|
-
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t"
|
23
|
+
"PreviewTextURL": "http://createsend.com/t/r-E97A7BB2E6983DA1/t",
|
24
|
+
"Tags": []
|
23
25
|
}
|
24
26
|
]
|
@@ -10,7 +10,8 @@
|
|
10
10
|
"ReplyTo": "myemail@example.com",
|
11
11
|
"DateCreated": "2011-05-24 10:37:00",
|
12
12
|
"PreviewURL": "http://createsend.com/t/r-DD543521A87C9B8B",
|
13
|
-
"PreviewTextURL": "http://createsend.com/t/r-DD543521A87C9B8B/t"
|
13
|
+
"PreviewTextURL": "http://createsend.com/t/r-DD543521A87C9B8B/t",
|
14
|
+
"Tags": ["tagexample"]
|
14
15
|
},
|
15
16
|
{
|
16
17
|
"DateScheduled": "2011-05-29 11:20:00",
|
@@ -23,6 +24,7 @@
|
|
23
24
|
"ReplyTo": "myemail@example.com",
|
24
25
|
"DateCreated": "2011-05-24 10:39:00",
|
25
26
|
"PreviewURL": "http://createsend.com/t/r-DD913521A87C9B8B",
|
26
|
-
"PreviewTextURL": "http://createsend.com/t/r-DD913521A87C9B8B/t"
|
27
|
+
"PreviewTextURL": "http://createsend.com/t/r-DD913521A87C9B8B/t",
|
28
|
+
"Tags": []
|
27
29
|
}
|
28
30
|
]
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"EmailAddress": "personone@example.com",
|
5
5
|
"Name": "Person One",
|
6
6
|
"Date": "2010-10-27 13:13:00",
|
7
|
+
"ListJoinedDate": "2010-10-27 13:13:00",
|
7
8
|
"State": "Active",
|
8
9
|
"CustomFields": []
|
9
10
|
},
|
@@ -11,6 +12,7 @@
|
|
11
12
|
"EmailAddress": "persontwo@example.com",
|
12
13
|
"Name": "Person Two",
|
13
14
|
"Date": "2010-10-27 13:13:00",
|
15
|
+
"ListJoinedDate": "2010-10-27 13:13:00",
|
14
16
|
"State": "Active",
|
15
17
|
"CustomFields": []
|
16
18
|
}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"EmailAddress": "subscriber@example.com",
|
3
3
|
"Name": "Subscriber One",
|
4
|
+
"MobileNumber": "+61423153526",
|
4
5
|
"Date": "2010-10-25 10:28:00",
|
6
|
+
"ListJoinedDate": "2010-10-25 10:28:00",
|
5
7
|
"State": "Active",
|
6
8
|
"CustomFields": [
|
7
9
|
{
|
@@ -18,5 +20,6 @@
|
|
18
20
|
}
|
19
21
|
],
|
20
22
|
"ReadsEmailWith": "Gmail",
|
21
|
-
"ConsentToTrack": "Yes"
|
23
|
+
"ConsentToTrack": "Yes",
|
24
|
+
"ConsentToSendSms": "No"
|
22
25
|
}
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"EmailAddress": "subs+7t8787Y@example.com",
|
5
5
|
"Name": "Unconfirmed One",
|
6
6
|
"Date": "2010-10-25 10:28:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 10:28:00",
|
7
8
|
"State": "Unconfirmed",
|
8
9
|
"CustomFields": [
|
9
10
|
{
|
@@ -12,12 +13,14 @@
|
|
12
13
|
}
|
13
14
|
],
|
14
15
|
"ReadsEmailWith": "",
|
15
|
-
"ConsentToTrack": "Yes"
|
16
|
+
"ConsentToTrack": "Yes",
|
17
|
+
"ConsentToSendSms": "No"
|
16
18
|
},
|
17
19
|
{
|
18
20
|
"EmailAddress": "subs+7878787y8ggg@example.com",
|
19
21
|
"Name": "Unconfirmed Two",
|
20
22
|
"Date": "2010-10-25 12:17:00",
|
23
|
+
"ListJoinedDate": "2010-10-25 12:17:00",
|
21
24
|
"State": "Unconfirmed",
|
22
25
|
"CustomFields": [
|
23
26
|
{
|
@@ -26,7 +29,8 @@
|
|
26
29
|
}
|
27
30
|
],
|
28
31
|
"ReadsEmailWith": "",
|
29
|
-
"ConsentToTrack": "No"
|
32
|
+
"ConsentToTrack": "No",
|
33
|
+
"ConsentToSendSms": "No"
|
30
34
|
}
|
31
35
|
],
|
32
36
|
"ResultsOrderedBy": "email",
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"EmailAddress": "subscriber@example.com",
|
5
5
|
"Name": "Unsub One",
|
6
6
|
"Date": "2010-10-25 13:11:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 13:11:00",
|
7
8
|
"State": "Unsubscribed",
|
8
9
|
"CustomFields": [],
|
9
10
|
"ReadsEmailWith": "Gmail"
|
@@ -12,6 +13,7 @@
|
|
12
13
|
"EmailAddress": "subscriberone@example.com",
|
13
14
|
"Name": "Subscriber",
|
14
15
|
"Date": "2010-10-25 13:04:00",
|
16
|
+
"ListJoinedDate": "2010-10-25 13:04:00",
|
15
17
|
"State": "Unsubscribed",
|
16
18
|
"CustomFields": [
|
17
19
|
{
|
@@ -25,6 +27,7 @@
|
|
25
27
|
"EmailAddress": "example+1@example.com",
|
26
28
|
"Name": "Example One",
|
27
29
|
"Date": "2010-10-26 10:56:00",
|
30
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
28
31
|
"State": "Unsubscribed",
|
29
32
|
"CustomFields": [],
|
30
33
|
"ReadsEmailWith": ""
|
@@ -33,6 +36,7 @@
|
|
33
36
|
"EmailAddress": "example+2@example.com",
|
34
37
|
"Name": "Example Two",
|
35
38
|
"Date": "2010-10-26 10:56:00",
|
39
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
36
40
|
"State": "Unsubscribed",
|
37
41
|
"CustomFields": [],
|
38
42
|
"ReadsEmailWith": ""
|
@@ -41,6 +45,7 @@
|
|
41
45
|
"EmailAddress": "example+3@example.com",
|
42
46
|
"Name": "Example Three",
|
43
47
|
"Date": "2010-10-26 10:56:00",
|
48
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
44
49
|
"State": "Unsubscribed",
|
45
50
|
"CustomFields": [],
|
46
51
|
"ReadsEmailWith": "Gmail"
|
@@ -53,4 +58,4 @@
|
|
53
58
|
"RecordsOnThisPage": 5,
|
54
59
|
"TotalNumberOfRecords": 5,
|
55
60
|
"NumberOfPages": 1
|
56
|
-
}
|
61
|
+
}
|
data/test/helper.rb
CHANGED
@@ -30,7 +30,7 @@ def createsend_url(auth, url)
|
|
30
30
|
if not url =~ /^http/
|
31
31
|
auth_section = ''
|
32
32
|
auth_section = "#{auth[:api_key]}:x@" if auth and auth.has_key? :api_key
|
33
|
-
result = "https://#{auth_section}api.createsend.com/api/v3.
|
33
|
+
result = "https://#{auth_section}api.createsend.com/api/v3.3/#{url}"
|
34
34
|
else
|
35
35
|
result = url
|
36
36
|
end
|
data/test/journey_test.rb
CHANGED
@@ -10,19 +10,19 @@ class JourneyTest < Test::Unit::TestCase
|
|
10
10
|
stub_get(@auth, "journeys/#{@journey.journey_id}.json", "journey_summary.json")
|
11
11
|
|
12
12
|
summary = @journey.summary
|
13
|
-
summary.Name.should == 'New journey'
|
14
|
-
summary.TriggerType.should == 'On Subscription'
|
15
|
-
summary.Status.should == 'Active'
|
16
|
-
|
17
|
-
summary.Emails.size.should == 1
|
18
|
-
summary.Emails.first.EmailID.should == 'b1b1b1b1b1b1b1b1b1b1'
|
19
|
-
summary.Emails.first.Name.should == 'New Email'
|
20
|
-
summary.Emails.first.Bounced.should == 0
|
21
|
-
summary.Emails.first.Clicked.should == 0
|
22
|
-
summary.Emails.first.Opened.should == 3
|
23
|
-
summary.Emails.first.Sent.should == 1
|
24
|
-
summary.Emails.first.UniqueOpened.should == 1
|
25
|
-
summary.Emails.first.Unsubscribed.should == 0
|
13
|
+
summary.Name.should be == 'New journey'
|
14
|
+
summary.TriggerType.should be == 'On Subscription'
|
15
|
+
summary.Status.should be == 'Active'
|
16
|
+
|
17
|
+
summary.Emails.size.should be == 1
|
18
|
+
summary.Emails.first.EmailID.should be == 'b1b1b1b1b1b1b1b1b1b1'
|
19
|
+
summary.Emails.first.Name.should be == 'New Email'
|
20
|
+
summary.Emails.first.Bounced.should be == 0
|
21
|
+
summary.Emails.first.Clicked.should be == 0
|
22
|
+
summary.Emails.first.Opened.should be == 3
|
23
|
+
summary.Emails.first.Sent.should be == 1
|
24
|
+
summary.Emails.first.UniqueOpened.should be == 1
|
25
|
+
summary.Emails.first.Unsubscribed.should be == 0
|
26
26
|
end
|
27
27
|
|
28
28
|
should "return a paged list of recipients of a particular email" do
|
@@ -34,17 +34,17 @@ class JourneyTest < Test::Unit::TestCase
|
|
34
34
|
"&orderdirection=asc", "journey_recipients.json")
|
35
35
|
|
36
36
|
recipients = @journey.email_recipients email_id = 'b1b1b1b1b1b1b1b1b1b1', date = journey_date, page = 2, page_size = 5, order_direction = 'asc'
|
37
|
-
recipients.Results.size.should == 4
|
38
|
-
recipients.Results.first.EmailAddress.should == 'example+1@example.com'
|
39
|
-
recipients.Results.first.SentDate.should == '2019-07-12 09:45:00'
|
40
|
-
|
41
|
-
recipients.ResultsOrderedBy.should == 'SentDate'
|
42
|
-
recipients.OrderDirection.should == 'ASC'
|
43
|
-
recipients.PageNumber.should == 2
|
44
|
-
recipients.PageSize.should == 10
|
45
|
-
recipients.RecordsOnThisPage.should == 4
|
46
|
-
recipients.TotalNumberOfRecords.should == 14
|
47
|
-
recipients.NumberOfPages.should == 2
|
37
|
+
recipients.Results.size.should be == 4
|
38
|
+
recipients.Results.first.EmailAddress.should be == 'example+1@example.com'
|
39
|
+
recipients.Results.first.SentDate.should be == '2019-07-12 09:45:00'
|
40
|
+
|
41
|
+
recipients.ResultsOrderedBy.should be == 'SentDate'
|
42
|
+
recipients.OrderDirection.should be == 'ASC'
|
43
|
+
recipients.PageNumber.should be == 2
|
44
|
+
recipients.PageSize.should be == 10
|
45
|
+
recipients.RecordsOnThisPage.should be == 4
|
46
|
+
recipients.TotalNumberOfRecords.should be == 14
|
47
|
+
recipients.NumberOfPages.should be == 2
|
48
48
|
end
|
49
49
|
|
50
50
|
should "return a paged list of subscribers who opened given journey email" do
|
@@ -56,24 +56,24 @@ class JourneyTest < Test::Unit::TestCase
|
|
56
56
|
"&orderdirection=asc", "journey_opens.json")
|
57
57
|
|
58
58
|
opens = @journey.email_opens email = 'b1b1b1b1b1b1b1b1b1b1', date = journey_date, page = 2, page_size = 5, order_direction = 'asc'
|
59
|
-
opens.Results.size.should == 4
|
60
|
-
opens.Results.last.EmailAddress.should == "example+4@example.com"
|
61
|
-
opens.Results.last.Date.should == "2019-07-29 10:35:00"
|
62
|
-
opens.Results.last.IPAddress.should == "192.168.0.3"
|
63
|
-
opens.Results.last.Latitude.should == -33.8683
|
64
|
-
opens.Results.last.Longitude.should == 151.2086
|
65
|
-
opens.Results.last.City.should == "Sydney"
|
66
|
-
opens.Results.last.Region.should == "New South Wales"
|
67
|
-
opens.Results.last.CountryCode.should == "AU"
|
68
|
-
opens.Results.last.CountryName.should == "Australia"
|
69
|
-
|
70
|
-
opens.ResultsOrderedBy.should == "Date"
|
71
|
-
opens.OrderDirection.should == "ASC"
|
72
|
-
opens.PageNumber.should == 1
|
73
|
-
opens.PageSize.should == 1000
|
74
|
-
opens.RecordsOnThisPage.should == 4
|
75
|
-
opens.TotalNumberOfRecords.should == 4
|
76
|
-
opens.NumberOfPages.should == 1
|
59
|
+
opens.Results.size.should be == 4
|
60
|
+
opens.Results.last.EmailAddress.should be == "example+4@example.com"
|
61
|
+
opens.Results.last.Date.should be == "2019-07-29 10:35:00"
|
62
|
+
opens.Results.last.IPAddress.should be == "192.168.0.3"
|
63
|
+
opens.Results.last.Latitude.should be == -33.8683
|
64
|
+
opens.Results.last.Longitude.should be == 151.2086
|
65
|
+
opens.Results.last.City.should be == "Sydney"
|
66
|
+
opens.Results.last.Region.should be == "New South Wales"
|
67
|
+
opens.Results.last.CountryCode.should be == "AU"
|
68
|
+
opens.Results.last.CountryName.should be == "Australia"
|
69
|
+
|
70
|
+
opens.ResultsOrderedBy.should be == "Date"
|
71
|
+
opens.OrderDirection.should be == "ASC"
|
72
|
+
opens.PageNumber.should be == 1
|
73
|
+
opens.PageSize.should be == 1000
|
74
|
+
opens.RecordsOnThisPage.should be == 4
|
75
|
+
opens.TotalNumberOfRecords.should be == 4
|
76
|
+
opens.NumberOfPages.should be == 1
|
77
77
|
end
|
78
78
|
|
79
79
|
should "return a paged list of subscribers who clicked on a journey email" do
|
@@ -85,25 +85,25 @@ class JourneyTest < Test::Unit::TestCase
|
|
85
85
|
"&orderdirection=asc", "journey_clicks.json")
|
86
86
|
|
87
87
|
clicks = @journey.email_clicks email = 'b1b1b1b1b1b1b1b1b1b1', date = journey_date, page = 1, page_size = 2, order_direction = 'asc'
|
88
|
-
clicks.Results.size.should == 2
|
89
|
-
clicks.Results.first.EmailAddress.should == "example+1@example.com"
|
90
|
-
clicks.Results.first.Date.should == "2019-07-29 10:33:00"
|
91
|
-
clicks.Results.first.URL.should == "http://test.com"
|
92
|
-
clicks.Results.first.IPAddress.should == "192.168.0.3"
|
93
|
-
clicks.Results.first.Latitude.should == -33.8683
|
94
|
-
clicks.Results.first.Longitude.should == 151.2086
|
95
|
-
clicks.Results.first.City.should == "Sydney"
|
96
|
-
clicks.Results.first.Region.should == "New South Wales"
|
97
|
-
clicks.Results.first.CountryCode.should == "AU"
|
98
|
-
clicks.Results.first.CountryName.should == "Australia"
|
99
|
-
|
100
|
-
clicks.ResultsOrderedBy.should == "Date"
|
101
|
-
clicks.OrderDirection.should == "ASC"
|
102
|
-
clicks.PageNumber.should == 1
|
103
|
-
clicks.PageSize.should == 2
|
104
|
-
clicks.RecordsOnThisPage.should == 2
|
105
|
-
clicks.TotalNumberOfRecords.should == 5
|
106
|
-
clicks.NumberOfPages.should == 3
|
88
|
+
clicks.Results.size.should be == 2
|
89
|
+
clicks.Results.first.EmailAddress.should be == "example+1@example.com"
|
90
|
+
clicks.Results.first.Date.should be == "2019-07-29 10:33:00"
|
91
|
+
clicks.Results.first.URL.should be == "http://test.com"
|
92
|
+
clicks.Results.first.IPAddress.should be == "192.168.0.3"
|
93
|
+
clicks.Results.first.Latitude.should be == -33.8683
|
94
|
+
clicks.Results.first.Longitude.should be == 151.2086
|
95
|
+
clicks.Results.first.City.should be == "Sydney"
|
96
|
+
clicks.Results.first.Region.should be == "New South Wales"
|
97
|
+
clicks.Results.first.CountryCode.should be == "AU"
|
98
|
+
clicks.Results.first.CountryName.should be == "Australia"
|
99
|
+
|
100
|
+
clicks.ResultsOrderedBy.should be == "Date"
|
101
|
+
clicks.OrderDirection.should be == "ASC"
|
102
|
+
clicks.PageNumber.should be == 1
|
103
|
+
clicks.PageSize.should be == 2
|
104
|
+
clicks.RecordsOnThisPage.should be == 2
|
105
|
+
clicks.TotalNumberOfRecords.should be == 5
|
106
|
+
clicks.NumberOfPages.should be == 3
|
107
107
|
end
|
108
108
|
|
109
109
|
should "return a paged list of subscribers who unsubscribed from a journey email" do
|
@@ -115,18 +115,18 @@ class JourneyTest < Test::Unit::TestCase
|
|
115
115
|
"&orderdirection=desc", "journey_unsubscribes.json")
|
116
116
|
|
117
117
|
unsubscribes = @journey.email_unsubscribes email = 'b1b1b1b1b1b1b1b1b1b1', date = journey_date, page = 1, page_size = 10, order_direction = 'desc'
|
118
|
-
unsubscribes.Results.size.should == 3
|
119
|
-
unsubscribes.Results.first.EmailAddress.should == "example+1@example.com"
|
120
|
-
unsubscribes.Results.first.Date.should == "2019-07-29 10:33:00"
|
121
|
-
unsubscribes.Results.first.IPAddress.should == "192.168.0.3"
|
122
|
-
|
123
|
-
unsubscribes.ResultsOrderedBy.should == "Date"
|
124
|
-
unsubscribes.OrderDirection.should == "ASC"
|
125
|
-
unsubscribes.PageNumber.should == 1
|
126
|
-
unsubscribes.PageSize.should == 1000
|
127
|
-
unsubscribes.RecordsOnThisPage.should == 4
|
128
|
-
unsubscribes.TotalNumberOfRecords.should == 4
|
129
|
-
unsubscribes.NumberOfPages.should == 1
|
118
|
+
unsubscribes.Results.size.should be == 3
|
119
|
+
unsubscribes.Results.first.EmailAddress.should be == "example+1@example.com"
|
120
|
+
unsubscribes.Results.first.Date.should be == "2019-07-29 10:33:00"
|
121
|
+
unsubscribes.Results.first.IPAddress.should be == "192.168.0.3"
|
122
|
+
|
123
|
+
unsubscribes.ResultsOrderedBy.should be == "Date"
|
124
|
+
unsubscribes.OrderDirection.should be == "ASC"
|
125
|
+
unsubscribes.PageNumber.should be == 1
|
126
|
+
unsubscribes.PageSize.should be == 1000
|
127
|
+
unsubscribes.RecordsOnThisPage.should be == 4
|
128
|
+
unsubscribes.TotalNumberOfRecords.should be == 4
|
129
|
+
unsubscribes.NumberOfPages.should be == 1
|
130
130
|
end
|
131
131
|
|
132
132
|
should "return a paged list of emails that bounced for a journey email" do
|
@@ -138,19 +138,19 @@ class JourneyTest < Test::Unit::TestCase
|
|
138
138
|
"&orderdirection=desc", "journey_bounces.json")
|
139
139
|
|
140
140
|
bounces = @journey.email_bounces email = 'b1b1b1b1b1b1b1b1b1b1', date = journey_date, page = 20, page_size = 5, order_direction = 'desc'
|
141
|
-
bounces.Results.size.should == 4
|
142
|
-
bounces.Results.first.EmailAddress.should == "example+1@example.com"
|
143
|
-
bounces.Results.first.BounceType.should == "4"
|
144
|
-
bounces.Results.first.Date.should == "2019-07-29 10:33:00"
|
145
|
-
bounces.Results.first.Reason.should == "Soft Bounce - Mailbox Full"
|
146
|
-
|
147
|
-
bounces.ResultsOrderedBy.should == "Date"
|
148
|
-
bounces.OrderDirection.should == "ASC"
|
149
|
-
bounces.PageNumber.should == 1
|
150
|
-
bounces.PageSize.should == 1000
|
151
|
-
bounces.RecordsOnThisPage.should == 4
|
152
|
-
bounces.TotalNumberOfRecords.should == 4
|
153
|
-
bounces.NumberOfPages.should == 1
|
141
|
+
bounces.Results.size.should be == 4
|
142
|
+
bounces.Results.first.EmailAddress.should be == "example+1@example.com"
|
143
|
+
bounces.Results.first.BounceType.should be == "4"
|
144
|
+
bounces.Results.first.Date.should be == "2019-07-29 10:33:00"
|
145
|
+
bounces.Results.first.Reason.should be == "Soft Bounce - Mailbox Full"
|
146
|
+
|
147
|
+
bounces.ResultsOrderedBy.should be == "Date"
|
148
|
+
bounces.OrderDirection.should be == "ASC"
|
149
|
+
bounces.PageNumber.should be == 1
|
150
|
+
bounces.PageSize.should be == 1000
|
151
|
+
bounces.RecordsOnThisPage.should be == 4
|
152
|
+
bounces.TotalNumberOfRecords.should be == 4
|
153
|
+
bounces.NumberOfPages.should be == 1
|
154
154
|
end
|
155
155
|
end
|
156
156
|
end
|