eroi 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/eroi.gemspec +1 -1
- data/lib/eroi/client.rb +3 -3
- data/test/eroi/client_test.rb +9 -0
- data/test/remote/client_test.rb +16 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/eroi.gemspec
CHANGED
data/lib/eroi/client.rb
CHANGED
@@ -46,11 +46,11 @@ module EROI
|
|
46
46
|
:clear_record => 1 ))
|
47
47
|
end
|
48
48
|
|
49
|
-
def define_list(list,
|
49
|
+
def define_list(list, emails)
|
50
50
|
xml = Builder::XmlMarkup.new
|
51
51
|
xml.tag!('DefineMailingList', 'list' => list) do |x|
|
52
|
-
|
53
|
-
x.tag!('Email',
|
52
|
+
emails.each do |email|
|
53
|
+
x.tag!('Email', email)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
data/test/eroi/client_test.rb
CHANGED
@@ -108,6 +108,15 @@ class TestClient < Test::Unit::TestCase
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
context "when defining a list" do
|
112
|
+
should "respond with a success" do
|
113
|
+
response = @client.define_list('TestList', [ 'longbob@longbob.com' ])
|
114
|
+
|
115
|
+
assert_equal true, response.success?
|
116
|
+
assert_equal 1, response.number_of_records
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
111
120
|
context "when sending an edition" do
|
112
121
|
setup do
|
113
122
|
@xml = mock('Builder::XmlMarkup')
|
data/test/remote/client_test.rb
CHANGED
@@ -156,6 +156,22 @@ class TestClient < Test::Unit::TestCase
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
+
context "when defining a list" do
|
160
|
+
teardown do
|
161
|
+
@client.remove_contact('longbob@longbob.com')
|
162
|
+
@client.remove_contact('shortbob@shortbob.com')
|
163
|
+
end
|
164
|
+
|
165
|
+
should "respond with a success" do
|
166
|
+
response = @client.define_list(
|
167
|
+
'TestList',
|
168
|
+
[ 'longbob@longbob.com', 'shortbob@shortbob.com' ])
|
169
|
+
|
170
|
+
assert_equal true, response.success?
|
171
|
+
assert_equal 2, response.number_of_records
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
159
175
|
context "when sending an email to a contact" do
|
160
176
|
teardown do
|
161
177
|
@client.remove_contact('longbob@longbob.com')
|