From 590d7634d0614517e699e9e3306a43aba8f8ee49 Mon Sep 17 00:00:00 2001 From: maxdemarzi Date: Sun, 6 Feb 2011 21:31:03 -0800 Subject: [PATCH] make sure we're actually getting the right node and relationships in the index --- spec/integration/rest_index_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/spec/integration/rest_index_spec.rb b/spec/integration/rest_index_spec.rb index ec368cc..20fd9bc 100644 --- a/spec/integration/rest_index_spec.rb +++ b/spec/integration/rest_index_spec.rb @@ -101,4 +101,29 @@ end end + describe "query index" do + it "can query a node index" do + new_node = @neo.create_node + key = generate_text(6) + value = generate_text + @neo.add_node_to_index("test_index", key, value, new_node) + new_index = @neo.get_node_index("test_index", key, value) + new_index.first["self"].should == new_node["self"] + @neo.remove_node_from_index("test_index", key, value, new_node) + end + + it "can get a relationship index" do + new_node1 = @neo.create_node + new_node2 = @neo.create_node + new_relationship = @neo.create_relationship("friends", new_node1, new_node2) + key = generate_text(6) + value = generate_text + @neo.add_relationship_to_index("test_index", key, value, new_relationship) + new_index = @neo.get_relationship_index("test_index", key, value) + new_index.first["self"].should == new_relationship["self"] + @neo.remove_relationship_from_index("test_index", key, value, new_relationship) + end + end + + end \ No newline at end of file