Take a screenshot of the bookmark
This commit is contained in:
parent
a5d3ba7829
commit
33cf91f6d5
10 changed files with 1854 additions and 1456 deletions
31
tests/Feature/BookmarksTest.php
Normal file
31
tests/Feature/BookmarksTest.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Tests\TestToken;
|
||||
use App\Jobs\ProcessBookmark;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class BookmarksTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions, TestToken;
|
||||
|
||||
public function test_browsershot_job_dispatches_when_bookmark_added()
|
||||
{
|
||||
Queue::fake();
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $this->getToken(),
|
||||
])->post('/api/post', [
|
||||
'h' => 'entry',
|
||||
'bookmark-of' => 'https://example.org/blog-post',
|
||||
]);
|
||||
|
||||
$response->assertJson(['response' => 'created']);
|
||||
|
||||
Queue::assertPushed(ProcessBookmark::class);
|
||||
$this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue