mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-20 20:04:20 -06:00
45 lines
1.4 KiB
PHP
45 lines
1.4 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.');
|
|
|
|
$poll = \App\Models\Poll::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('polls.votes.index', [$poll]));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('poll.result');
|
|
$response->assertViewHas('poll', $poll);
|
|
$response->assertViewHas('total_votes');
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('store validates with a form request', function (): void {
|
|
$this->assertActionUsesFormRequest(
|
|
\App\Http\Controllers\PollVoteController::class,
|
|
'store',
|
|
\App\Http\Requests\StorePollVoteRequest::class
|
|
);
|
|
});
|
|
|
|
test('store 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)->post(route('polls.votes.store', [$poll]), [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
// test cases...
|