Skip to content

Commit

Permalink
add delete test. Will not work on 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Oct 23, 2012
1 parent a4a3d31 commit 173a9a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/integration/rest_plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
existing_node["data"][0][0]["self"].split('/').last.should == id
end

it "can delete everything but start node" do
@neo.execute_query("START n=node(*) MATCH n-[r?]-() WHERE ID(n) <> 0 DELETE n,r")
expect {
@neo.execute_query("start n=node({id}) return n", {:id => 1})
}.to raise_error(Neography::BadInputException)
root_node = @neo.execute_query("start n=node({id}) return n", {:id => 0})
root_node.should_not be_nil
end

it "throws an error for an invalid query" do
expect {
@neo.execute_query("this is not a query")
Expand Down

0 comments on commit 173a9a4

Please sign in to comment.