| @@ 51-67 (lines=17) @@ | ||
| 48 | } | |
| 49 | ||
| 50 | /** @test */ | |
| 51 | public function it_can_subscribe_someone() | |
| 52 |     { | |
| 53 | $email = '[email protected]'; | |
| 54 | ||
| 55 | $url = 'lists/123/members'; | |
| 56 | ||
| 57 |         $this->mailChimpApi->shouldReceive('post')->withArgs([ | |
| 58 | $url, | |
| 59 | [ | |
| 60 | 'email_address' => $email, | |
| 61 | 'status' => 'subscribed', | |
| 62 | 'email_type' => 'html', | |
| 63 | ], | |
| 64 | ]); | |
| 65 | ||
| 66 | $this->newsletter->subscribe($email); | |
| 67 | } | |
| 68 | ||
| 69 | /** @test */ | |
| 70 | public function it_can_subscribe_someone_as_pending() | |
| @@ 70-86 (lines=17) @@ | ||
| 67 | } | |
| 68 | ||
| 69 | /** @test */ | |
| 70 | public function it_can_subscribe_someone_as_pending() | |
| 71 |     { | |
| 72 | $email = '[email protected]'; | |
| 73 | ||
| 74 | $url = 'lists/123/members'; | |
| 75 | ||
| 76 |         $this->mailChimpApi->shouldReceive('post')->withArgs([ | |
| 77 | $url, | |
| 78 | [ | |
| 79 | 'email_address' => $email, | |
| 80 | 'status' => 'pending', | |
| 81 | 'email_type' => 'html', | |
| 82 | ], | |
| 83 | ]); | |
| 84 | ||
| 85 | $this->newsletter->subscribePending($email); | |
| 86 | } | |
| 87 | ||
| 88 | /** @test */ | |
| 89 | public function it_can_subscribe_or_update_someone() | |
| @@ 170-188 (lines=19) @@ | ||
| 167 | } | |
| 168 | ||
| 169 | /** @test */ | |
| 170 | public function it_can_subscribe_someone_to_an_alternative_list() | |
| 171 |     { | |
| 172 | $email = '[email protected]'; | |
| 173 | ||
| 174 | $url = 'lists/456/members'; | |
| 175 | ||
| 176 |         $this->mailChimpApi->shouldReceive('post') | |
| 177 | ->once() | |
| 178 | ->withArgs([ | |
| 179 | $url, | |
| 180 | [ | |
| 181 | 'email_address' => $email, | |
| 182 | 'status' => 'subscribed', | |
| 183 | 'email_type' => 'html', | |
| 184 | ], | |
| 185 | ]); | |
| 186 | ||
| 187 | $this->newsletter->subscribe($email, [], 'list2'); | |
| 188 | } | |
| 189 | ||
| 190 | /** @test */ | |
| 191 | public function it_can_subscribe_or_update_someone_to_an_alternative_list() | |