@@ -698,7 +698,7 @@ describe('ACL', function() {
698698
699699 describe ( "ACL group test" , function ( ) {
700700 var groupTriples = "<#> a <http://xmlns.com/foaf/0.1/Group>;\n" +
701- " <http://xmlns.com/foaf/0.1/member> <a>, <b>, <" + user2 + ">. " ;
701+ " <http://xmlns.com/foaf/0.1/member> <a>, <b>, <" + user2 + "> .\n " ;
702702 var body = "<#Owner>\n" +
703703 " <http://www.w3.org/ns/auth/acl#accessTo> <" + address + abcFile + ">, <" +
704704 address + abcAclFile + ">;\n" +
@@ -762,62 +762,62 @@ describe('ACL', function() {
762762 done ( ) ;
763763 } ) ;
764764 } ) ;
765- // it("user2 should not be able to access test file's ACL file", function(done) {
766- // var options = createOptions(abcAclFile, 'user2');
767- // request.head(options, function(error, response, body) {
768- // assert.equal(error, null);
769- // assert.equal(response.statusCode, 403);
770- // done();
771- // });
772- // });
773- // it("user2 should be able to access test file", function(done) {
774- // var options = createOptions(abcFile, 'user2');
775- // request.head(options, function(error, response, body) {
776- // assert.equal(error, null);
777- // assert.equal(response.statusCode, 200);
778- // done();
779- // });
780- // });
781- // it("user2 should not be able to modify test file", function(done) {
782- // var options = createOptions(abcFile, 'user2');
783- // options.headers = {
784- // 'content-type': 'text/turtle'
785- // };
786- // options.body = "<d> <e> <f> .\n";
787- // request.put(options, function(error, response, body) {
788- // assert.equal(error, null);
789- // assert.equal(response.statusCode, 403);
790- // done();
791- // });
792- // });
793- // it("agent should not be able to access test file", function(done) {
794- // var options = createOptions(abcFile);
795- // request.head(options, function(error, response, body) {
796- // assert.equal(error, null);
797- // assert.equal(response.statusCode, 401);
798- // done();
799- // });
800- // });
801- // it("agent should not be able to modify test file", function(done) {
802- // var options = createOptions(abcFile);
803- // options.headers = {
804- // 'content-type': 'text/turtle'
805- // };
806- // options.body = "<d> <e> <f> .\n";
807- // request.put(options, function(error, response, body) {
808- // assert.equal(error, null);
809- // assert.equal(response.statusCode, 401);
810- // done();
811- // });
812- // });
813- it ( "user1 should be able to delete group file" , function ( done ) {
814- var options = createOptions ( groupFile , 'user1' ) ;
815- request . del ( options , function ( error , response , body ) {
765+ it ( "user2 should not be able to access test file's ACL file" , function ( done ) {
766+ var options = createOptions ( abcAclFile , 'user2' ) ;
767+ request . head ( options , function ( error , response , body ) {
768+ assert . equal ( error , null ) ;
769+ assert . equal ( response . statusCode , 403 ) ;
770+ done ( ) ;
771+ } ) ;
772+ } ) ;
773+ it ( "user2 should be able to access test file" , function ( done ) {
774+ var options = createOptions ( abcFile , 'user2' ) ;
775+ request . head ( options , function ( error , response , body ) {
816776 assert . equal ( error , null ) ;
817777 assert . equal ( response . statusCode , 200 ) ;
818778 done ( ) ;
819779 } ) ;
820780 } ) ;
781+ it ( "user2 should not be able to modify test file" , function ( done ) {
782+ var options = createOptions ( abcFile , 'user2' ) ;
783+ options . headers = {
784+ 'content-type' : 'text/turtle'
785+ } ;
786+ options . body = "<d> <e> <f> .\n" ;
787+ request . put ( options , function ( error , response , body ) {
788+ assert . equal ( error , null ) ;
789+ assert . equal ( response . statusCode , 403 ) ;
790+ done ( ) ;
791+ } ) ;
792+ } ) ;
793+ it ( "agent should not be able to access test file" , function ( done ) {
794+ var options = createOptions ( abcFile ) ;
795+ request . head ( options , function ( error , response , body ) {
796+ assert . equal ( error , null ) ;
797+ assert . equal ( response . statusCode , 401 ) ;
798+ done ( ) ;
799+ } ) ;
800+ } ) ;
801+ it ( "agent should not be able to modify test file" , function ( done ) {
802+ var options = createOptions ( abcFile ) ;
803+ options . headers = {
804+ 'content-type' : 'text/turtle'
805+ } ;
806+ options . body = "<d> <e> <f> .\n" ;
807+ request . put ( options , function ( error , response , body ) {
808+ assert . equal ( error , null ) ;
809+ assert . equal ( response . statusCode , 401 ) ;
810+ done ( ) ;
811+ } ) ;
812+ } ) ;
813+ // it("user1 should be able to delete group file", function(done) {
814+ // var options = createOptions(groupFile, 'user1');
815+ // request.del(options, function(error, response, body) {
816+ // assert.equal(error, null);
817+ // assert.equal(response.statusCode, 200);
818+ // done();
819+ // });
820+ // });
821821 it ( "user1 should be able to delete test file's ACL file" , function ( done ) {
822822 var options = createOptions ( abcAclFile , 'user1' ) ;
823823 request . del ( options , function ( error , response , body ) {
0 commit comments