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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fb832f8a06a77964741782ed647222f6e07b699
4
- data.tar.gz: 35c92f64211ff1ce04051f3c400e8c2ad2a6ab5e
3
+ metadata.gz: b25b207a9d98d8d91b97cc89d81fa54a5e4c4682
4
+ data.tar.gz: 6952a1994f28df70620701d149f7b63ce28f5f62
5
5
  SHA512:
6
- metadata.gz: 6dc10894079897b1558b98819fb7be8329de159380fdb7b3f715c623cdd24331500048a37dbfed2b82a5ce1121348075f08261f7c40b61c6365db3f4bd987baa
7
- data.tar.gz: adbc33c69f9bc0d56e98b48c4729cce0c5a285432f39130cd0ff8160fa5bac5360a2e6aca09e9085fee839e709d6cbc6d09da9f1e7c8ada0fa28f9e1cf967f9c
6
+ metadata.gz: 5c9ba66f85eb0b8daba40ce07459fb40e79d036c717f7b0ce5476e83b77320b6411d908fa15dda17ed1f9cc8a35d4ed169c505530f3cc36c35d8b1e2611acdc6
7
+ data.tar.gz: d40907899d4723ed18dd99b77c8035c6c99d82f32e911abd7f9496183de673ee344b39a1edf5b8718592fd7cc03605f4fa1d0cb5b1285982b7450c80cbbddfa4
@@ -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
- subscriptions = response.body[:select_members_ex_response][:return][:item]
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]
@@ -1,3 +1,3 @@
1
1
  module FailMail
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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.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-20 00:00:00.000000000 Z
11
+ date: 2014-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler