Skip to content

Commit

Permalink
Merge pull request #494 from tighten/ajm/fix-queued-conference-search…
Browse files Browse the repository at this point in the history
…-errors

Fix conference search error
  • Loading branch information
andrewmile authored Dec 8, 2023
2 parents 4dacacf + a28956f commit f30753a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/Models/UuidBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class UuidBase extends Eloquent
*/
public $incrementing = false;

protected $keyType = 'string';

/**
* Boot function from laravel.
*/
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="SCOUT_DRIVER" value="database"/>
<env name="SCOUT_DRIVER" value="collection"/>
<env name="CAPTCHA_PUBLIC" value="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"/>
<env name="CAPTCHA_PRIVATE" value="6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe"/>
</php>
Expand Down
12 changes: 12 additions & 0 deletions tests/Feature/ConferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1215,4 +1215,16 @@ function checking_whether_a_conferences_is_rejected()
$this->assertFalse($conferenceA->isRejected());
$this->assertTrue($conferenceB->isRejected());
}

/** @test */
public function searching_conferences_by_name(): void
{
$conferenceA = Conference::factory()->create(['location' => 'Boston, MA']);
$conferenceB = Conference::factory()->create(['location' => 'New York, NY']);

$results = Conference::searchQuery('boston', fn ($query) => $query)->get();

$this->assertContains($conferenceA->id, $results->pluck('id'));
$this->assertNotContains($conferenceB->id, $results->pluck('id'));
}
}

0 comments on commit f30753a

Please sign in to comment.