/** @test
  * @group */
 public function it_creates_interest_group_with_mailChimp()
 {
     $model = new SaveInterestModel();
     $interest = m::mock(Interest::class);
     $interest->shouldReceive('setAttribute')->with('interest_id', m::any());
     $ia = new InterestActions(new Client(), $interest);
     return $ia->add($model);
 }
 /** @test
  * @group  */
 public function it_creates_interest_group()
 {
     $this->model = new SaveInterestModel();
     $response = m::mock(\Psr\Http\Message\ResponseInterface::class);
     $apiKey = getenv('MAILCHIMP_API');
     $this->guzzle->shouldReceive('request')->with('POST', $this->endpoint . "/3.0/lists/{$this->model->getInterestListId()}/interest-categories/{$this->model->getInterestCategoryId()}/interests", ['headers' => ['Authorization' => 'OAuth ' . $apiKey], 'json' => ['name' => $this->model->getInterestName(), 'display_order' => $this->model->getInterestDisplayOrder()]])->andReturn($response);
     $response->shouldReceive('getBody')->andReturn(json_encode(['id' => '1234']));
     $interest = m::mock(Interest::class);
     $interest->shouldReceive('setAttribute')->with('interest_id', 1234);
     $ia = new InterestActions($this->guzzle, $interest);
     $ia->add($this->model);
 }
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(InterestActions $mailChimp)
 {
     $mailChimp->add($this->model);
 }