Skip to content

Commit

Permalink
Merge branch 'release/5.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
bvlinsky committed Sep 25, 2023
2 parents c658e27 + 7639e7b commit 7db677e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Feature/ProductSearchDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,34 @@ public function testIndexIdsSearch($user): void
->assertJsonCount(2, 'data');
}

/**
* @dataProvider authProvider
*/
public function testIndexSearch($user): void
{
$this->{$user}->givePermissionTo('products.show');

Product::factory()->create([
'public' => true,
'name' => 'First',
]);

Product::factory()->create([
'public' => true,
'created_at' => Carbon::now()->addHour(),
'name' => 'Second',
]);

// This test check if there is no SQL error that 'name' is ambiguous
$this
->actingAs($this->{$user})
->json('GET', '/products', [
'search' => 'First',
'sort' => 'attribute.data-wydania:desc',
])
->assertOk();
}

/**
* @dataProvider authProvider
*/
Expand Down

0 comments on commit 7db677e

Please sign in to comment.