From a052a729233755b371390df8b21a5171b4b351bc Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 16 Oct 2026 21:35:16 +0200 Subject: [PATCH] test(git): cover deploy key setup with custom ssh username Closes #11665 --- ...ployKeyApplicationCreationAuthorizationTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Feature/Authorization/DeployKeyApplicationCreationAuthorizationTest.php b/tests/Feature/Authorization/DeployKeyApplicationCreationAuthorizationTest.php index 1146c0cbf5..59be95e55c 100644 --- a/tests/Feature/Authorization/DeployKeyApplicationCreationAuthorizationTest.php +++ b/tests/Feature/Authorization/DeployKeyApplicationCreationAuthorizationTest.php @@ -99,6 +99,20 @@ test('deploy key application keeps an ssh url with a custom port', function () { ->toBe('ssh://git@gitea.example.local:2222/myuser/my-repository.git'); }); +test('deploy key application keeps an scp-style ssh url with a custom username', function () { + actAsDeployKeyUser($this->admin, $this->team); + + deployKeyComponent() + ->call('setPrivateKey', $this->privateKey->id) + ->set('repository_url', 'custom-user@github.example.com:organization/repository.git') + ->set('branch', 'main') + ->call('submit') + ->assertHasNoErrors(); + + expect(Application::query()->sole()->git_repository) + ->toBe('custom-user@github.example.com:organization/repository.git'); +}); + test('member cannot invoke the deploy key selection action directly', function () { actAsDeployKeyUser($this->member, $this->team); $this->withoutExceptionHandling();