gnumarcelo-campaigning 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +14 -3
- data/VERSION.yml +1 -1
- data/test/campaigning_test.rb +44 -47
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Campaigning
|
2
2
|
|
3
|
-
This
|
3
|
+
This is a Ruby wrapper around CampaignMonitor API(www.campaignmonitor.com/api) using SOAP.
|
4
4
|
|
5
5
|
|
6
6
|
== Pre-requisites
|
@@ -22,9 +22,20 @@ This gem requires the following gems:
|
|
22
22
|
sudo gem install gnumarcelo-campaigning -s http://gems.github.com
|
23
23
|
|
24
24
|
|
25
|
-
|
25
|
+
=== Configuring your API key
|
26
|
+
require 'campaigning'
|
27
|
+
CAMPAIGN_MONITOR_API_KEY = '_put_here_your_api_key_'
|
26
28
|
|
27
|
-
|
29
|
+
|
30
|
+
== Usage
|
31
|
+
|
32
|
+
This gem provides a set of classes to access all available information on Campaign Monitor.
|
33
|
+
|
34
|
+
These are the list of classes:
|
35
|
+
|
36
|
+
Campaigning, Campaigning::Client, Campaigning::Campaign, Campaigning::List and Campaigning::Subscriber
|
37
|
+
|
38
|
+
The examples below assumes you have set *CAMPAIGN_MONITOR_API_KEY* constant with your Campaign monitor API.
|
28
39
|
|
29
40
|
Sample use of the Client class:
|
30
41
|
|
data/VERSION.yml
CHANGED
data/test/campaigning_test.rb
CHANGED
@@ -2,56 +2,53 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
# Replace this API key with your own (http://www.campaignmonitor.com/api/)
|
4
4
|
CAMPAIGN_MONITOR_API_KEY = '54cae7f3aa1f35cb3bb5bc41756d8b7f'
|
5
|
-
CLIENT_ID = 'd7acfd4cd2ffffc2d86b8903d18a1276'
|
6
|
-
CLIENT_TWO_ID = '730acd1e8d27d56bdb87e88685613d72'
|
5
|
+
#CLIENT_ID = 'd7acfd4cd2ffffc2d86b8903d18a1276'
|
6
|
+
#CLIENT_TWO_ID = '730acd1e8d27d56bdb87e88685613d72'
|
7
7
|
|
8
8
|
class CampaigningTest < Test::Unit::TestCase
|
9
9
|
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# def test_user_get_time_zones
|
18
|
-
# time_zones = Campaigning.time_zones
|
19
|
-
# assert !time_zones.nil?
|
20
|
-
# end
|
11
|
+
def test_campaigning_system_date
|
12
|
+
date = Campaigning.system_date
|
13
|
+
assert !date.nil?
|
14
|
+
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
def test_user_get_time_zones
|
17
|
+
time_zones = Campaigning.time_zones
|
18
|
+
assert !time_zones.nil?
|
19
|
+
end
|
26
20
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
21
|
+
def test_user_countries
|
22
|
+
countries = Campaigning.countries
|
23
|
+
assert !countries.nil?
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_client_get_all_clients
|
27
|
+
clients = Campaigning::Client.get_all_clients
|
28
|
+
assert clients.length > 0
|
29
|
+
#clients.each{ |c| puts c.clientID + " - " + c.name }
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_client_lists
|
33
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
34
|
+
assert client.lists.length > 0
|
35
|
+
end
|
38
36
|
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
#
|
38
|
+
def test_client_create
|
39
|
+
client_created = Campaigning::Client.create(
|
40
|
+
:company_name => "My test client",
|
41
|
+
:contact_name => "Oswald Green15",
|
42
|
+
:email_address => "og15@user.com",
|
43
|
+
:country => "Ireland",
|
44
|
+
:time_zone => Campaigning.time_zones[1]
|
45
|
+
)
|
46
|
+
assert !client_created.clientID.nil?
|
47
|
+
end
|
48
|
+
|
52
49
|
# def test_client_delete
|
53
|
-
# response = Campaigning::Client.delete(
|
54
|
-
#
|
50
|
+
# response = Campaigning::Client.delete(client_created.clientID)
|
51
|
+
# assert response.code == 0
|
55
52
|
# end
|
56
53
|
#
|
57
54
|
# def test_client_delete_itself
|
@@ -66,11 +63,11 @@ class CampaigningTest < Test::Unit::TestCase
|
|
66
63
|
# end
|
67
64
|
|
68
65
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
def test_find_client_by_name
|
67
|
+
client = Campaigning::Client.find_by_name("Client One Company")
|
68
|
+
puts client.inspect
|
69
|
+
assert !client.nil? && client.name == "Client One Company"
|
70
|
+
end
|
74
71
|
|
75
72
|
|
76
73
|
# def test_get_client_campaigns
|
@@ -100,7 +97,7 @@ class CampaigningTest < Test::Unit::TestCase
|
|
100
97
|
# Design and Span test Fee: #{access_and_billing_details.designAndSpamTestFee} - \n
|
101
98
|
# Access Level: #{access_and_billing_details.accessLevel}"
|
102
99
|
|
103
|
-
|
100
|
+
assert !client.details.nil?
|
104
101
|
|
105
102
|
end
|
106
103
|
|