Skip to content

Commit

Permalink
remove http assert from
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilReinking committed Nov 9, 2023
1 parent 9ef1fae commit ae3e872
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/Feature/FormSubmissionTriggersFormWebhooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Models\FormSessionResponse;
use App\Models\FormWebhook;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Queue;

uses(RefreshDatabase::class);
Expand Down Expand Up @@ -65,30 +64,3 @@

Queue::assertPushed(CallWebhookJob::class, 0);
});

it('submits to configured webhook url and http method', function () {
Http::fake();

$form = Form::factory()
->has(FormWebhook::factory([
'webhook_method' => 'GET',
'webhook_url' => 'https://void.work/submit',
]))->create();

$session = FormSession::factory()->for($form)
->has(FormSessionResponse::factory([
'value' => 'test response',
]))
->completed()
->create();

with(new FormSubmitWebhookListener())
->handle(new FormSessionCompletedEvent($session));

Http::assertSent(function ($request) use ($form) {
$webhook = $form->formWebhooks[0];

return $request->url() === $webhook->webhook_url
&& $request->method() === strtoupper($webhook->webhook_method);
});
});

0 comments on commit ae3e872

Please sign in to comment.