Skip to content

Commit e4bb2e9

Browse files
committed
fixed todo and added .meta test in patch-test
1 parent d56cdf0 commit e4bb2e9

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

test/integration/http-test.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -891,13 +891,6 @@ describe('HTTP APIs', function () {
891891
.set('content-type', 'text/turtle')
892892
.expect(403, done)
893893
})
894-
it('should not error with 400 if slug contains invalid suffix', function (done) { // TODO find better name
895-
server.post('/post-tests/')
896-
.set('slug', 'put-resource.acl.ttl')
897-
.send(postRequest1Body)
898-
.set('content-type', 'text-turtle')
899-
.expect(201, done)
900-
})
901894
it('should error with 400 if the body is empty and no content type is provided', function (done) {
902895
server.post('/post-tests/')
903896
.set('slug', 'post-resource-empty-fail')
@@ -921,6 +914,15 @@ describe('HTTP APIs', function () {
921914
.expect(hasHeader('acl', suffixAcl))
922915
.expect(201, done)
923916
})
917+
it('should create new resource even if slug contains invalid suffix', function (done) {
918+
server.post('/post-tests/')
919+
.set('slug', 'put-resource.acl.ttl')
920+
.send(postRequest1Body)
921+
.set('content-type', 'text-turtle')
922+
.expect(hasHeader('describedBy', suffixMeta))
923+
.expect(hasHeader('acl', suffixAcl))
924+
.expect(201, done)
925+
})
924926
it('should fail return 404 if no parent container found', function (done) {
925927
server.post('/hello.html/')
926928
.send(postRequest1Body)

test/integration/patch-test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ describe('PATCH through text/n3', () => {
131131
result: '@prefix : </new.n3#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
132132
}))
133133

134-
describe('on an N3 file that has an invalid uri', describePatch({
134+
describe('on an N3 file that has an invalid uri (*.acl)', describePatch({
135135
path: '/foo/bar.acl/test.n3',
136136
exists: false,
137137
patch: `<> a solid:InsertDeletePatch;
@@ -141,6 +141,16 @@ describe('PATCH through text/n3', () => {
141141
text: 'contained reserved suffixes in path'
142142
}))
143143

144+
describe('on an N3 file that has an invalid uri (*.meta)', describePatch({
145+
path: '/foo/bar/xyz.meta/test.n3',
146+
exists: false,
147+
patch: `<> a solid:InsertDeletePatch;
148+
solid:insers { <x> <y> <z>. }.`
149+
}, {
150+
status: 400,
151+
text: 'contained reserved suffixes in path'
152+
}))
153+
144154
describe('on a resource with read-only access', describePatch({
145155
path: '/read-only.ttl',
146156
patch: `<> a solid:InsertDeletePatch;

0 commit comments

Comments
 (0)