Use new syndication target model when processing MicroPub requests
This commit is contained in:
parent
976929e9b9
commit
66257e7e9b
6 changed files with 61 additions and 52 deletions
|
@ -7,6 +7,7 @@ namespace Tests\Feature;
|
|||
use App\Jobs\ProcessBookmark;
|
||||
use App\Jobs\SyndicateBookmarkToTwitter;
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\SyndicationTarget;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Tests\TestCase;
|
||||
|
@ -36,6 +37,11 @@ class BookmarksTest extends TestCase
|
|||
{
|
||||
Queue::fake();
|
||||
|
||||
SyndicationTarget::factory()->create([
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'service_name' => 'Twitter',
|
||||
]);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $this->getToken(),
|
||||
])->post('/api/post', [
|
||||
|
@ -58,6 +64,11 @@ class BookmarksTest extends TestCase
|
|||
{
|
||||
Queue::fake();
|
||||
|
||||
SyndicationTarget::factory()->create([
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'service_name' => 'Twitter',
|
||||
]);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $this->getToken(),
|
||||
])->json('POST', '/api/post', [
|
||||
|
@ -82,6 +93,11 @@ class BookmarksTest extends TestCase
|
|||
{
|
||||
Queue::fake();
|
||||
|
||||
SyndicationTarget::factory()->create([
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'service_name' => 'Twitter',
|
||||
]);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $this->getToken(),
|
||||
])->post('/api/post', [
|
||||
|
|
|
@ -126,6 +126,12 @@ class MicropubControllerTest extends TestCase
|
|||
public function micropubClientCanRequestTheNewNoteIsSyndicatedToTwitter(): void
|
||||
{
|
||||
Queue::fake();
|
||||
|
||||
SyndicationTarget::factory()->create([
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'service_name' => 'Twitter',
|
||||
]);
|
||||
|
||||
$faker = Factory::create();
|
||||
$note = $faker->text;
|
||||
$response = $this->post(
|
||||
|
@ -233,6 +239,11 @@ class MicropubControllerTest extends TestCase
|
|||
'path' => 'test-photo.jpg',
|
||||
'type' => 'image',
|
||||
]);
|
||||
SyndicationTarget::factory()->create([
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'service_name' => 'Twitter',
|
||||
]);
|
||||
|
||||
$faker = Factory::create();
|
||||
$note = $faker->text;
|
||||
$response = $this->postJson(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue