Finish re-working tests to run on test database

This commit is contained in:
Jonny Barnes 2021-08-31 12:28:00 +01:00
parent 09fc211623
commit 1abca77bdc
50 changed files with 535 additions and 265 deletions

View file

@ -4,21 +4,22 @@ declare(strict_types=1);
namespace Tests\Feature;
use App\Models\Note;
use Tests\TestCase;
class NotesControllerTest extends TestCase
{
/*
/**
* Test the `/notes` page returns 200, this should
* mean the database is being hit.
*
* @test
*
*/
public function notesPageLoads(): void
{
$response = $this->get('/notes');
$response->assertStatus(200);
}*/
}
/**
* Test a specific note.
@ -27,10 +28,12 @@ class NotesControllerTest extends TestCase
*/
public function specificNotePageLoads(): void
{
$response = $this->get('/notes/D');
$note = Note::factory()->create();
$response = $this->get($note->longurl);
$response->assertViewHas('note');
}
/** @todo */
/* @test *
public function noteReplyingToTweet(): void
{
@ -45,8 +48,9 @@ class NotesControllerTest extends TestCase
*/
public function oldNoteUrlsRedirect(): void
{
$response = $this->get('/note/11');
$response->assertRedirect(config('app.url') . '/notes/B');
$note = Note::factory()->create();
$response = $this->get('/note/' . $note->id);
$response->assertRedirect($note->longurl);
}
/**