@@ -98,6 +98,28 @@ describe('ResourceMapper', () => {
9898 contentType : 'image/jpeg'
9999 } )
100100
101+ itMapsUrl ( mapper , 'a URL with an overridden extension that matches the content type' ,
102+ {
103+ url : 'http://localhost/space/foo.acl' ,
104+ contentType : 'text/turtle' ,
105+ createIfNotExists : true
106+ } ,
107+ {
108+ path : `${ rootPath } space/foo.acl` ,
109+ contentType : 'text/turtle'
110+ } )
111+
112+ itMapsUrl ( mapper , 'a URL with an alternative overridden extension that matches the content type' ,
113+ {
114+ url : 'http://localhost/space/foo.acl' ,
115+ contentType : 'text/n3' ,
116+ createIfNotExists : true
117+ } ,
118+ {
119+ path : `${ rootPath } space/foo.acl$.n3` ,
120+ contentType : 'text/n3'
121+ } )
122+
101123 // GET/HEAD/POST/DELETE/PATCH base cases
102124
103125 itMapsUrl ( mapper , 'a URL of a non-existing file' ,
@@ -192,6 +214,30 @@ describe('ResourceMapper', () => {
192214 contentType : 'text/html'
193215 } )
194216
217+ itMapsUrl ( mapper , 'a URL of an existing .acl file' ,
218+ {
219+ url : 'http://localhost/space/.acl'
220+ } ,
221+ [
222+ `${ rootPath } space/.acl`
223+ ] ,
224+ {
225+ path : `${ rootPath } space/.acl` ,
226+ contentType : 'text/turtle'
227+ } )
228+
229+ itMapsUrl ( mapper , 'a URL of an existing .acl file with a different content type' ,
230+ {
231+ url : 'http://localhost/space/.acl'
232+ } ,
233+ [
234+ `${ rootPath } space/.acl$.n3`
235+ ] ,
236+ {
237+ path : `${ rootPath } space/.acl$.n3` ,
238+ contentType : 'text/n3'
239+ } )
240+
195241 itMapsUrl ( mapper , 'a URL ending with a slash to an index file when index.html is available' ,
196242 {
197243 url : 'http://localhost/space/'
@@ -290,6 +336,13 @@ describe('ResourceMapper', () => {
290336 contentType : 'text/turtle'
291337 } )
292338
339+ itMapsFile ( mapper , 'an ACL file' ,
340+ { path : `${ rootPath } space/.acl` } ,
341+ {
342+ url : 'http://localhost/space/.acl' ,
343+ contentType : 'text/turtle'
344+ } )
345+
293346 itMapsFile ( mapper , 'an unknown file type' ,
294347 { path : `${ rootPath } space/foo.bar` } ,
295348 {
0 commit comments