midwife-client 0.0.4 → 0.0.5

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.
@@ -43,6 +43,9 @@ module Midwife
43
43
  raise ArgumentError, "list_id is required"
44
44
  }
45
45
 
46
+ # transform into an array
47
+ attributes['subscription_ids[]'] = attributes.delete(:subscription_ids) || []
48
+
46
49
  request "/lists/#{list_id}/recipients", attributes
47
50
  end
48
51
 
@@ -1,5 +1,5 @@
1
1
  module Midwife
2
2
  class Client
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -59,11 +59,11 @@ describe Midwife::Client do
59
59
 
60
60
  describe '#create_recipient' do
61
61
  it 'adds a recipient to the list' do
62
- client.create_recipient(:list_id => 42, :email => 'michael@jordan.com')
62
+ client.create_recipient(:list_id => 42, :email => 'michael@jordan.com', :subscription_ids => [1, 2])
63
63
 
64
64
  last_request.path.should == "/lists/42/recipients"
65
65
  last_request.method.should == :post
66
- last_request.params.should == { :email => 'michael@jordan.com' }
66
+ last_request.params.should == { :email => 'michael@jordan.com', 'subscription_ids[]' => [1, 2] }
67
67
  end
68
68
 
69
69
  context 'when list_id is missing' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midwife-client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Guterl