mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-03-01 11:19:40 +03:00
My Account: Updated and started adding to tests
- Updated existing tests now affected by my-account changes. - Updated some existing tests to more accuractly check the scenario. - Updated some code styling in SocialController. - Fixed redirects for social account flows to fit my-account. - Added test for social account attaching. - Added test for api token redirect handling.
This commit is contained in:
@@ -51,7 +51,7 @@ class WebhookCallTest extends TestCase
|
||||
{
|
||||
// This test must not fake the queue/bus since this covers an issue
|
||||
// around handling and serialization of items now deleted from the database.
|
||||
$this->newWebhook(['active' => true, 'endpoint' => 'https://wh.example.com'], ['all']);
|
||||
$webhook = $this->newWebhook(['active' => true, 'endpoint' => 'https://wh.example.com'], ['all']);
|
||||
$this->mockHttpClient([new Response(500)]);
|
||||
|
||||
$user = $this->users->newUser();
|
||||
@@ -61,8 +61,10 @@ class WebhookCallTest extends TestCase
|
||||
/** @var ApiToken $apiToken */
|
||||
$editor = $this->users->editor();
|
||||
$apiToken = ApiToken::factory()->create(['user_id' => $editor]);
|
||||
$resp = $this->delete($editor->getEditUrl('/api-tokens/' . $apiToken->id));
|
||||
$resp->assertRedirect($editor->getEditUrl('#api_tokens'));
|
||||
$this->delete($apiToken->getUrl())->assertRedirect();
|
||||
|
||||
$webhook->refresh();
|
||||
$this->assertEquals('Response status from endpoint was 500', $webhook->last_error);
|
||||
}
|
||||
|
||||
public function test_failed_webhook_call_logs_error()
|
||||
|
||||
Reference in New Issue
Block a user