File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33module Drip
44 class Client
55 module Subscribers
6+ # Public: Fetch a subscriber.
7+ #
8+ # options - A Hash of options.
9+ # - status - Optional. Filter by one of the following statuses:
10+ # active, or unsubscribed, or removed. Defaults to all.
11+ # - page - Optional. Use this parameter to paginate through
12+ # your list of subscribers. Each response contains a
13+ # a `meta` object that includes `total_count` and
14+ # `total_pages` attributes.
15+ #
16+ # Returns a Drip::Response.
17+ # See https://www.getdrip.com/docs/rest-api#list_subscribers
18+ def subscribers ( options = { } )
19+ get "#{ account_id } /subscribers" , options
20+ end
21+
622 # Public: Fetch a subscriber.
723 #
824 # id_or_email - Required. The String id or email address of the subscriber.
Original file line number Diff line number Diff line change @@ -12,6 +12,22 @@ def setup
1212 @client . expects ( :connection ) . at_least_once . returns ( @connection )
1313 end
1414
15+ context "#subscribers" do
16+ setup do
17+ @response_status = 200
18+ @response_body = stub
19+
20+ @stubs . get "12345/subscribers" do
21+ [ @response_status , { } , @response_body ]
22+ end
23+ end
24+
25+ should "send the right request" do
26+ expected = Drip ::Response . new ( @response_status , @response_body )
27+ assert_equal expected , @client . subscribers
28+ end
29+ end
30+
1531 context "#subscriber" do
1632 setup do
1733 @id = "derrick@getdrip.com"
You can’t perform that action at this time.
0 commit comments