$resp->assertElementExists('a[href="' . $webhook->getUrl() . '"]', $webhook->name);
$resp->assertSee($webhook->endpoint);
$resp->assertSee('All system events');
+ $resp->assertSee('Active');
}
public function test_create_view()
'name' => 'My first webhook',
'endpoint' => 'https://example.com/webhook',
'events' => ['all'],
+ 'active' => 'true'
]);
$resp->assertRedirect('/settings/webhooks');
$this->assertDatabaseHas('webhooks', [
'name' => 'My first webhook',
'endpoint' => 'https://example.com/webhook',
+ 'active' => true,
]);
/** @var Webhook $webhook */
'name' => 'My updated webhook',
'endpoint' => 'https://example.com/updated-webhook',
'events' => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE],
+ 'active' => 'true'
]);
$resp->assertRedirect('/settings/webhooks');
'id' => $webhook->id,
'name' => 'My updated webhook',
'endpoint' => 'https://example.com/updated-webhook',
+ 'active' => true,
]);
$trackedEvents = $webhook->trackedEvents()->get();