Take a screenshot of the bookmark

This commit is contained in:
Jonny Barnes 2017-10-13 12:31:31 +01:00
parent a5d3ba7829
commit 33cf91f6d5
10 changed files with 1854 additions and 1456 deletions

View 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']);
}
}