Skip to content

Commit

Permalink
adding can reset the properties of a relationship test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Mar 6, 2012
1 parent 208b317 commit 4ffc2e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/integration/rest_batch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@
existing_relationship["self"].should == new_relationship["self"]
end

it "can reset the properties of a relationship" do
node1 = @neo.create_node
node2 = @neo.create_node
new_relationship = @neo.create_relationship("friends", node1, node2, {:since => "high school"})
batch_result = @neo.batch [:reset_relationship_properties, new_relationship, {"since" => "college", "dated" => "yes"}]
batch_result.first.should have_key("id")
batch_result.first.should have_key("from")
existing_relationship = @neo.get_relationship(batch_result.first["from"].split('/')[2])
existing_relationship["type"].should == "friends"
existing_relationship["data"]["since"].should == "college"
existing_relationship["data"]["dated"].should == "yes"
existing_relationship["start"].split('/').last.should == node1["self"].split('/').last
existing_relationship["end"].split('/').last.should == node2["self"].split('/').last
existing_relationship["self"].should == new_relationship["self"]
end

it "can add a node to an index" do
new_node = @neo.create_node
key = generate_text(6)
Expand Down

0 comments on commit 4ffc2e2

Please sign in to comment.