I have elastic search working when not in a testing environment. However when I create a model in a test for some reason it does not work. I have tried running it with the queue and without the queue. I can see that the job gets created and that the job runs before making the call. However, I am able to pull things that are already in the database in the test code. Any ideas why it would not work in testing?
This is my test code
$user = $this->newLoggedInUser();
$invoice = factory(App\Invoice::class)->create(['account_id' => $user->account_id]);
$this->get($this->url() . '?q=' . $invoice->title, $this->userAuthHeader($user))
->seeJson([
'Title' => 'Invoice: ' . $invoice->number . ($invoice->title ? ' - ' . $invoice->title : ''),
'Description' => 'Customer: ' . $invoice->customer->name,
'Type' => 'Invoice',
])
->assertResponseStatus(200);