@@ 47-63 (lines=17) @@ | ||
44 | } |
|
45 | ||
46 | /** @test */ |
|
47 | public function it_can_subscribe_someone() |
|
48 | { |
|
49 | $email = '[email protected]'; |
|
50 | ||
51 | $url = 'lists/123/members'; |
|
52 | ||
53 | $this->mailChimpApi->shouldReceive('post')->withArgs([ |
|
54 | $url, |
|
55 | [ |
|
56 | 'email_address' => $email, |
|
57 | 'status' => 'subscribed', |
|
58 | 'email_type' => 'html', |
|
59 | ], |
|
60 | ]); |
|
61 | ||
62 | $this->newsletter->subscribe($email); |
|
63 | } |
|
64 | ||
65 | /** @test */ |
|
66 | public function it_can_subscribe_or_update_someone() |
|
@@ 147-165 (lines=19) @@ | ||
144 | } |
|
145 | ||
146 | /** @test */ |
|
147 | public function it_can_subscribe_someone_to_an_alternative_list() |
|
148 | { |
|
149 | $email = '[email protected]'; |
|
150 | ||
151 | $url = 'lists/456/members'; |
|
152 | ||
153 | $this->mailChimpApi->shouldReceive('post') |
|
154 | ->once() |
|
155 | ->withArgs([ |
|
156 | $url, |
|
157 | [ |
|
158 | 'email_address' => $email, |
|
159 | 'status' => 'subscribed', |
|
160 | 'email_type' => 'html', |
|
161 | ], |
|
162 | ]); |
|
163 | ||
164 | $this->newsletter->subscribe($email, [], 'list2'); |
|
165 | } |
|
166 | ||
167 | /** @test */ |
|
168 | public function it_can_subscribe_or_update_someone_to_an_alternative_list() |