mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-20 20:04:20 -06:00
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('index returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$polls = \App\Models\Poll::factory()->times(3)->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('polls.index'));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('poll.latest');
|
|
$response->assertViewHas('polls', $polls);
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('show returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$poll = \App\Models\Poll::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('polls.show', [$poll]));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('poll.show');
|
|
$response->assertViewHas('poll', $poll);
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
// test cases...
|