Skip to content

Commit

Permalink
make sure we're actually getting the right node and relationships in …
Browse files Browse the repository at this point in the history
…the index
  • Loading branch information
maxdemarzi committed Feb 7, 2011
1 parent 6dac3ab commit 590d763
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/integration/rest_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 590d763

Please sign in to comment.