fix test update news with picture
Tests & Lint & Deploy to Railway / build (2.7.6, 20.x, 8.3) (push) Successful in 2m35s Details
Tests & Lint & Deploy to Railway / deploy (push) Successful in 32s Details

This commit is contained in:
aslan 2024-06-11 10:39:24 +03:00
parent 18df25c6a8
commit 7206bab9c2
1 changed files with 2 additions and 1 deletions

View File

@ -79,9 +79,10 @@ class NewsTest extends TestCase
public function testUpdateNews(): void
{
$file = UploadedFile::fake()->create('fake.jpg', 100);
$response = $this->actingAs($this->user)
->withSession(['banned' => false])
->patch(route('news.update', $this->news), $this->data);
->patch(route('news.update', $this->news), [...$this->data, 'photo' => $file]);
$response->assertRedirect(route('news.index'));