Skip to content

Commit

Permalink
Add failing test for sparql-update PATCH
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Oct 8, 2016
1 parent 6028de1 commit c1553d3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/lib/derby/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,19 @@
.to include RDF::LDP::NonRDFSource.to_uri
end
end

describe 'PATCH' do
it 'updates an RDF resource' do
rdf = '<http://example.org/1> <http://example.org/ns#foo> "foo" .'
header 'Content-type', 'application/n-triples'
post '/', rdf
resource_path = URI.parse(last_response['Location']).path

sparql = 'DELETE { <> <http://example.org/ns#foo> ?change . } WHERE { <> <http://example.org/ns#foo> ?change . } ; INSERT { <> <http://example.org/ns#foo> "bar" . } WHERE { }'
header 'Content-type', 'application/sparql-update'
patch resource_path, sparql
expect(last_response.status).to eq 200
end
end
end
end

0 comments on commit c1553d3

Please sign in to comment.