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.
Files changed (4) hide show
  1. data/README.rdoc +14 -3
  2. data/VERSION.yml +1 -1
  3. data/test/campaigning_test.rb +44 -47
  4. metadata +1 -1
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Campaigning
2
2
 
3
- This RubyGem provides access to the CampaignMonitor API(www.campaignmonitor.com/api) using SOAP.
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
- == How to play
25
+ === Configuring your API key
26
+ require 'campaigning'
27
+ CAMPAIGN_MONITOR_API_KEY = '_put_here_your_api_key_'
26
28
 
27
- Just set a constant named *CAMPAIGN_MONITOR_API_KEY* with your Campaign monitor API key and start to play like the examples below:
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
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 8
4
- :patch: 0
4
+ :patch: 1
@@ -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
- # def test_campaigning_system_date
12
- # date = Campaigning.system_date
13
- # assert !date.nil?
14
- # puts date
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
- # def test_user_countries
23
- # countries = Campaigning.countries
24
- # assert !countries.nil?
25
- # end
16
+ def test_user_get_time_zones
17
+ time_zones = Campaigning.time_zones
18
+ assert !time_zones.nil?
19
+ end
26
20
 
27
- # def test_client_get_all_clients
28
- # clients = Campaigning::Client.get_all_clients
29
- # assert clients.length > 0
30
- # clients.each{ |c| puts c.clientID + " - " + c.name }
31
- # end
32
- #
33
- #
34
- # def test_client_lists
35
- # client = Campaigning::Client.new(CLIENT_ID)
36
- # assert client.lists.length > 0
37
- # end
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
- # def test_client_create
41
- # client_created = Campaigning::Client.create(
42
- # :company_name => "Orange Company 15",
43
- # :contact_name => "Oswald Green15",
44
- # :email_address => "og15@user.com",
45
- # :country => "Ireland",
46
- # :time_zone => @cm.time_zones[1]
47
- # )
48
- # assert client_created.clientID != nil
49
- # end
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("50a1893ea0a02fc94f2ee9563766e539")
54
- # puts response.inspect
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
- # def test_find_client_by_name
70
- # client = Campaigning::Client.find_by_name("Client One Company")
71
- # puts client.inspect
72
- # # assert client != nil && client.name == "Client One Company"
73
- # end
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
- puts client.details.inspect != nil
100
+ assert !client.details.nil?
104
101
 
105
102
  end
106
103
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnumarcelo-campaigning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Menezes