Skip to content

Commit

Permalink
200 in case of non-matching deletes.
Browse files Browse the repository at this point in the history
Fixes #1085
  • Loading branch information
RubenVerborgh committed Feb 6, 2019
1 parent 1af8a46 commit 6dc8013
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions test/integration/patch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ describe('PATCH', () => {
patch: `<> solid:patches <https://tim.localhost:7777/read-write.ttl>;
solid:deletes { <x> <y> <z>. }.`
}, { // expected:
status: 409,
text: 'The patch could not be applied'
status: 200,
text: 'Patch applied successfully',
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\n'
}))

describe('with a matching WHERE clause', describePatch({
Expand Down Expand Up @@ -307,8 +308,9 @@ describe('PATCH', () => {
solid:inserts { <x> <y> <z>. };
solid:deletes { <a> <b> <c>. }.`
}, { // expected:
status: 409,
text: 'The patch could not be applied'
status: 200,
text: 'Patch applied successfully',
result: '@prefix : </new.ttl#>.\n@prefix tim: </>.\n\ntim:x tim:y tim:z.\n\n'
}))

describe('on a resource with read-only access', describePatch({
Expand Down Expand Up @@ -361,8 +363,9 @@ describe('PATCH', () => {
solid:inserts { <x> <y> <z>. };
solid:deletes { <x> <y> <z>. }.`
}, { // expected:
status: 409,
text: 'The patch could not be applied'
status: 200,
text: 'Patch applied successfully',
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
}))

describe('with a patch for existing data', describePatch({
Expand All @@ -382,8 +385,9 @@ describe('PATCH', () => {
solid:inserts { <x> <y> <z>. };
solid:deletes { <q> <s> <s>. }.`
}, { // expected:
status: 409,
text: 'The patch could not be applied'
status: 200,
text: 'Patch applied successfully',
result: '@prefix : </read-write.ttl#>.\n@prefix tim: </>.\n\ntim:a tim:b tim:c.\n\ntim:d tim:e tim:f.\n\ntim:x tim:y tim:z.\n\n'
}))

describe('with a matching WHERE clause', describePatch({
Expand Down Expand Up @@ -422,7 +426,7 @@ describe('PATCH', () => {
before(() => backup(filename))
after(() => restore(filename))
// Store its contents to verify non-modification
if (!result) {
if (typeof result !== 'string') {
originalContents = read(filename)
}
// Ensure a non-existing file is removed
Expand Down

0 comments on commit 6dc8013

Please sign in to comment.