Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

test(git): cover deploy key setup with custom ssh username

Andras Bacsaia052a7292337
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://[email protected]: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', '[email protected]:organization/repository.git')
+ ->set('branch', 'main')
+ ->call('submit')
+ ->assertHasNoErrors();
+
+ expect(Application::query()->sole()->git_repository)
+ ->toBe('[email protected]:organization/repository.git');
+});
+
test('member cannot invoke the deploy key selection action directly', function () {
actAsDeployKeyUser($this->member, $this->team);
$this->withoutExceptionHandling();