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,6 +4,8 @@ declare(strict_types=1);
namespace Tests\Feature;
use App\Models\Contact;
use App\Models\Note;
use Tests\TestCase;
class BridgyPosseTest extends TestCase
@ -11,9 +13,15 @@ class BridgyPosseTest extends TestCase
/** @test */
public function notesWeWantCopiedToTwitterShouldHaveNecessaryMarkup(): void
{
$response = $this->get('/notes/4');
Contact::factory()->create([
'nick' => 'joe',
'twitter' => 'joe__',
]);
$note = Note::factory()->create(['note' => 'Hi @joe']);
$response = $this->get($note->longurl);
$html = $response->content();
$this->assertTrue(is_string(mb_stristr($html, 'p-bridgy-twitter-content')));
$this->assertStringContainsString('p-bridgy-twitter-content', $html);
}
}