fail_mail 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fail_mail/member.rb +2 -1
- data/lib/fail_mail/version.rb +1 -1
- data/spec/fail_mail/member_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b25b207a9d98d8d91b97cc89d81fa54a5e4c4682
|
4
|
+
data.tar.gz: 6952a1994f28df70620701d149f7b63ce28f5f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c9ba66f85eb0b8daba40ce07459fb40e79d036c717f7b0ce5476e83b77320b6411d908fa15dda17ed1f9cc8a35d4ed169c505530f3cc36c35d8b1e2611acdc6
|
7
|
+
data.tar.gz: d40907899d4723ed18dd99b77c8035c6c99d82f32e911abd7f9496183de673ee344b39a1edf5b8718592fd7cc03605f4fa1d0cb5b1285982b7450c80cbbddfa4
|
data/lib/fail_mail/member.rb
CHANGED
@@ -26,7 +26,8 @@ module FailMail
|
|
26
26
|
FieldsToFetch: { string: %w[MemberID ListName MemberType] },
|
27
27
|
FilterCriteriaArray: { string: ["EmailAddress = #{email}", "MemberType = normal"] }
|
28
28
|
}
|
29
|
-
|
29
|
+
result = response.body[:select_members_ex_response] || {}
|
30
|
+
subscriptions = result.fetch(:return, {}).fetch(:item, [])
|
30
31
|
subscriptions.shift
|
31
32
|
subscriptions.map do |list|
|
32
33
|
member_id, list_name, _ = list[:item]
|
data/lib/fail_mail/version.rb
CHANGED
@@ -78,6 +78,15 @@ describe FailMail::Member do
|
|
78
78
|
savon.expects(:select_members_ex).with(options).returns xml_response
|
79
79
|
member.subscriptions.first.should be_a FailMail::Subscription
|
80
80
|
end
|
81
|
+
|
82
|
+
context "when the member has no subscriptions" do
|
83
|
+
let(:xml_response) { %Q{<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://tempuri.org/ns1.xsd" xmlns:ns="http://www.lyris.com/lmapi"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns:SelectMembersExResponse></ns:SelectMembersExResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>} }
|
84
|
+
it "returns an empty array" do
|
85
|
+
savon.expects(:select_members_ex).with(options).returns xml_response
|
86
|
+
member.subscriptions.should be_empty
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
81
90
|
end
|
82
91
|
|
83
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fail_mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Zaninovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|