@@ -22,7 +22,7 @@ describe('MongoDB', () => {
2222 const repoData = {
2323 name : 'sample' ,
2424 users : { canPush : [ ] } ,
25- url : 'http://example.com/sample-repo' ,
25+ url : 'http://example.com/sample-repo.git ' ,
2626 } ;
2727 repoCollection . findOne . resolves ( repoData ) ;
2828
@@ -38,47 +38,31 @@ describe('MongoDB', () => {
3838 const repoData = {
3939 name : 'sample' ,
4040 users : { canPush : [ ] } ,
41- url : 'https://github.com/finos/git-proxy' ,
42- } ;
43- repoCollection . findOne . resolves ( repoData ) ;
44-
45- const result = await getRepoByUrl ( 'https://github.com/finos/git-proxy' ) ;
46- expect ( result ) . to . equal ( repoData ) ;
47- expect ( connectionStub . calledWith ( 'repos' ) ) . to . be . true ;
48- expect (
49- repoCollection . findOne . calledWith ( { url : { $eq : 'https://github.com/finos/git-proxy' } } ) ,
50- ) . to . be . true ;
51- } ) ;
52-
53- it ( 'should get the repo using the url, stripping off the .git' , async ( ) => {
54- const repoData = {
55- name : 'sample' ,
56- users : { canPush : [ ] } ,
57- url : 'https://github.com/finos/git-proxy' ,
41+ url : 'https://github.com/finos/git-proxy.git' ,
5842 } ;
5943 repoCollection . findOne . resolves ( repoData ) ;
6044
6145 const result = await getRepoByUrl ( 'https://github.com/finos/git-proxy.git' ) ;
6246 expect ( result ) . to . equal ( repoData ) ;
6347 expect ( connectionStub . calledWith ( 'repos' ) ) . to . be . true ;
6448 expect (
65- repoCollection . findOne . calledWith ( { url : { $eq : 'https://github.com/finos/git-proxy' } } ) ,
49+ repoCollection . findOne . calledWith ( { url : { $eq : 'https://github.com/finos/git-proxy.git ' } } ) ,
6650 ) . to . be . true ;
6751 } ) ;
6852
6953 it ( 'should get the repo using the url, ignoring the case' , async ( ) => {
7054 const repoData = {
7155 name : 'sample' ,
7256 users : { canPush : [ ] } ,
73- url : 'https://github.com/finos/git-proxy' ,
57+ url : 'https://github.com/finos/git-proxy.git ' ,
7458 } ;
7559 repoCollection . findOne . resolves ( repoData ) ;
7660
7761 const result = await getRepoByUrl ( 'https://github.com/Finos/Git-Proxy.git' ) ;
7862 expect ( result ) . to . equal ( repoData ) ;
7963 expect ( connectionStub . calledWith ( 'repos' ) ) . to . be . true ;
8064 expect (
81- repoCollection . findOne . calledWith ( { url : { $eq : 'https://github.com/finos/git-proxy' } } ) ,
65+ repoCollection . findOne . calledWith ( { url : { $eq : 'https://github.com/finos/git-proxy.git ' } } ) ,
8266 ) . to . be . true ;
8367 } ) ;
8468 } ) ;
0 commit comments