Add test for note creation
This commit is contained in:
parent
f771119808
commit
29ef9c12d1
1 changed files with 15 additions and 1 deletions
|
@ -15,11 +15,25 @@ class MicropubClientTest extends DuskTestCase
|
||||||
public function test_client_page_see_authenticated()
|
public function test_client_page_see_authenticated()
|
||||||
{
|
{
|
||||||
$this->browse(function ($browser) {
|
$this->browse(function ($browser) {
|
||||||
$browser->visit('/micropub/create')
|
$browser->visit(route('micropub-client'))
|
||||||
->assertSee('You are authenticated');
|
->assertSee('You are authenticated');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_client_page_creates_new_note()
|
||||||
|
{
|
||||||
|
$faker = \Faker\Factory::create();
|
||||||
|
$note = 'Fake note from #LaravelDusk: ' . $faker->text;
|
||||||
|
$this->browse(function ($browser) use ($note) {
|
||||||
|
$browser->visit(route('micropub-client'))
|
||||||
|
->type('content', $note)
|
||||||
|
->press('Submit');
|
||||||
|
});
|
||||||
|
$this->assertDatabaseHas('notes', ['note' => $note]);
|
||||||
|
$newNote = \App\Note::where('note', $note)->first();
|
||||||
|
$newNote->forceDelete();
|
||||||
|
}
|
||||||
|
|
||||||
public function test_client_page_updates_syndication()
|
public function test_client_page_updates_syndication()
|
||||||
{
|
{
|
||||||
$this->browse(function ($browser) {
|
$this->browse(function ($browser) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue