@@ -52,6 +52,14 @@ public async Task AssumesItCanReadGitLabUrls()
52
52
Assert . AreEqual ( true , canRead ) ;
53
53
}
54
54
55
+ [ Test ]
56
+ public async Task AssumesItCanReadGitLabOrganisationUrls ( )
57
+ {
58
+ var canRead = await _gitlabSettingsReader . CanRead ( new Uri ( "https://gitlab.com/org/user/projectname.git" ) ) ;
59
+
60
+ Assert . AreEqual ( true , canRead ) ;
61
+ }
62
+
55
63
[ TestCase ( null ) ]
56
64
[ TestCase ( "master" ) ]
57
65
public async Task GetsCorrectSettingsFromTheUrl ( string targetBranch )
@@ -67,5 +75,21 @@ public async Task GetsCorrectSettingsFromTheUrl(string targetBranch)
67
75
Assert . AreEqual ( targetBranch , repositorySettings . RemoteInfo ? . BranchName ) ;
68
76
Assert . AreEqual ( false , repositorySettings . SetAutoMerge ) ;
69
77
}
78
+
79
+ [ TestCase ( null ) ]
80
+ [ TestCase ( "master" ) ]
81
+ public async Task GetsCorrectSettingsFromTheOrganisationUrl ( string targetBranch )
82
+ {
83
+ var repositoryUri = new Uri ( "https://gitlab.com/org/user/projectname.git" ) ;
84
+ var repositorySettings = await _gitlabSettingsReader . RepositorySettings ( repositoryUri , true , targetBranch ) ;
85
+
86
+ Assert . IsNotNull ( repositorySettings ) ;
87
+ Assert . AreEqual ( new Uri ( "https://gitlab.com/api/v4/" ) , repositorySettings . ApiUri ) ;
88
+ Assert . AreEqual ( repositoryUri , repositorySettings . RepositoryUri ) ;
89
+ Assert . AreEqual ( "org/user" , repositorySettings . RepositoryOwner ) ;
90
+ Assert . AreEqual ( "projectname" , repositorySettings . RepositoryName ) ;
91
+ Assert . AreEqual ( targetBranch , repositorySettings . RemoteInfo ? . BranchName ) ;
92
+ Assert . AreEqual ( false , repositorySettings . SetAutoMerge ) ;
93
+ }
70
94
}
71
95
}
0 commit comments