Skip to content

Commit 2812880

Browse files
committed
Making tests to see if the lack of exception handling simply gives 500 status with broken group listings
1 parent 52ccb14 commit 2812880

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

test/integration/acl-oidc-test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,26 @@ describe('ACL with WebID+OIDC over HTTP', function () {
578578
done()
579579
})
580580
})
581+
it('We should have a 500 with invalid group listings',
582+
function (done) {
583+
var options = createOptions('/group/test-folder/some-other-file.txt', 'user2')
584+
585+
request.get(options, function (error, response, body) {
586+
assert.equal(error, null)
587+
assert.equal(response.statusCode, 500)
588+
done()
589+
})
590+
})
591+
it('We should have a 404 for non-existent file',
592+
function (done) {
593+
var options = createOptions('/group/test-folder/nothere.txt', 'user2')
594+
595+
request.get(options, function (error, response, body) {
596+
assert.equal(error, null)
597+
assert.equal(response.statusCode, 404)
598+
done()
599+
})
600+
})
581601
})
582602

583603
describe('Restricted', function () {

test/resources/accounts-acl/tim.localhost/group/test-folder/.acl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
66

77
:owner
8+
a acl:Authorization;
89
acl:accessTo tes:;
910
acl:agent c:me;
1011
acl:defaultForNew tes:;
1112
acl:mode acl:Control, acl:Read, acl:Write.
12-
:public
13+
:folks
14+
a acl:Authorization;
1315
acl:accessTo tes:;
1416
acl:agentGroup <group-listing.ttl#folks>;
1517
acl:defaultForNew tes:;
1618
acl:mode acl:Read, acl:Write.
19+
:errors
20+
a acl:Authorization;
21+
acl:accessTo <some-other-file.txt>;
22+
acl:agentGroup <group-listing-error.ttl#folks>;
23+
acl:mode acl:Read, acl:Write.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is not Turtle...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nothing here

0 commit comments

Comments
 (0)