@@ -16,29 +16,36 @@ const invalidTurtleBody = fs.readFileSync(path.join(__dirname, '../resources/inv
1616
1717describe ( 'HTTP requests with invalid Turtle syntax' , ( ) => {
1818 describe ( 'PUT API' , ( ) => {
19- it ( 'should return 400' , ( done ) => {
20- server . put ( '/should-not-be-created.ttl' )
19+ it ( 'is allowed with invalid TTL files' , ( done ) => {
20+ server . put ( '/invalid1.ttl' )
21+ . send ( invalidTurtleBody )
22+ . set ( 'content-type' , 'text/turtle' )
23+ . expect ( 201 , done )
24+ } )
25+
26+ it ( 'is not allowed with invalid ACL files' , ( done ) => {
27+ server . put ( '/invalid1.ttl.acl' )
2128 . send ( invalidTurtleBody )
2229 . set ( 'content-type' , 'text/turtle' )
2330 . expect ( 400 , done )
2431 } )
2532 } )
2633
27- describe . skip ( 'PATCH API' , ( ) => {
28- it ( 'should return 400 ' , ( done ) => { // TODO: This returns 415 right now
34+ describe ( 'PATCH API' , ( ) => {
35+ it ( 'does not support patching of TTL files ' , ( done ) => {
2936 server . patch ( '/patch-1-initial.ttl' )
3037 . send ( invalidTurtleBody )
3138 . set ( 'content-type' , 'text/turtle' )
32- . expect ( 400 , done )
39+ . expect ( 415 , done )
3340 } )
3441 } )
3542
36- describe . skip ( 'POST API (multipart)' , ( ) => { // TODO: Is this something we should validate?
37- it ( 'should create as many files as the ones passed in multipart ' , ( done ) => {
43+ describe ( 'POST API (multipart)' , ( ) => {
44+ it ( 'does not validate files that are posted ' , ( done ) => {
3845 server . post ( '/' )
39- . attach ( 'timbl ' , path . join ( __dirname , '../resources/invalid1.ttl' ) )
40- . attach ( 'nicola ' , path . join ( __dirname , '../resources/invalid2.ttl' ) )
41- . expect ( 400 , done )
46+ . attach ( 'invalid1 ' , path . join ( __dirname , '../resources/invalid1.ttl' ) )
47+ . attach ( 'invalid2 ' , path . join ( __dirname , '../resources/invalid2.ttl' ) )
48+ . expect ( 200 , done )
4249 } )
4350 } )
4451} )
0 commit comments