Skip to content

Commit f29a258

Browse files
committed
add test
1 parent 7196543 commit f29a258

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

test/integration/acl-oidc-test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ describe('ACL with WebID+OIDC over HTTP', function () {
551551
done()
552552
})
553553
})
554-
it.skip('user1 should be able to PATCH a resource', function (done) {
554+
it('user1 should be able to PATCH a non existing resource', function (done) {
555555
const options = createOptions('/append-inherited/test.ttl', 'user1')
556556
options.body = 'INSERT DATA { :test :hello 456 .}'
557557
options.headers['content-type'] = 'application/sparql-update'
@@ -589,6 +589,16 @@ describe('ACL with WebID+OIDC over HTTP', function () {
589589
done()
590590
})
591591
})
592+
it('user2 should be able to PATCH insert on a non existing resource', function (done) {
593+
const options = createOptions('/append-inherited/new.ttl', 'user2')
594+
options.body = 'INSERT DATA { :test :hello 789 .}'
595+
options.headers['content-type'] = 'application/sparql-update'
596+
request.patch(options, function (error, response, body) {
597+
assert.equal(error, null)
598+
assert.equal(response.statusCode, 200)
599+
done()
600+
})
601+
})
592602
it('user2 should not be able to access test file\'s ACL file', function (done) {
593603
const options = createOptions('/append-acl/abc.ttl.acl', 'user2', 'text/turtle')
594604
request.head(options, function (error, response, body) {
@@ -648,6 +658,7 @@ describe('ACL with WebID+OIDC over HTTP', function () {
648658
})
649659
after(function () {
650660
rm('/accounts-acl/tim.localhost/append-inherited/test.ttl')
661+
rm('/accounts-acl/tim.localhost/append-inherited/new.ttl')
651662
})
652663
})
653664

test/resources/accounts-acl/tim.localhost/append-inherited/.acl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@
1111

1212
acl:default <./>.
1313

14+
<#AppendOnly>
15+
a <http://www.w3.org/ns/auth/acl#Authorization>;
16+
<http://www.w3.org/ns/auth/acl#accessTo> <./>;
17+
acl:default <./>;
18+
<http://www.w3.org/ns/auth/acl#agentClass> <http://xmlns.com/foaf/0.1/Agent>;
19+
<http://www.w3.org/ns/auth/acl#mode> <http://www.w3.org/ns/auth/acl#Read>, <http://www.w3.org/ns/auth/acl#Append> .

0 commit comments

Comments
 (0)