Skip to content

Commit

Permalink
add properties parameter to the batch method for create unique relati…
Browse files Browse the repository at this point in the history
…onship
  • Loading branch information
degzcs committed Mar 10, 2014
1 parent fe57645 commit 39a9053
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/unit/rest/batch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ class Rest

it "creates unique nodes" do
expected_body = [
{ "id" => 0, "method" => "POST", "to" => "/index/relationship/index1?unique", "body" => { "key" => "key1", "value" => "value1", "type" => "type1", "start" => "/node/node1", "end" => "/node/node2" } },
{ "id" => 1, "method" => "POST", "to" => "/index/relationship/index2?unique", "body" => { "key" => "key2", "value" => "value2", "type" => "type2", "start" => "{0}", "end" => "{1}" } }
{ "id" => 0, "method" => "POST", "to" => "/index/relationship/index1?unique", "body" => { "key" => "key1", "value" => "value1", "type" => "type1", "start" => "/node/node1", "end" => "/node/node2", "properties" => "properties" } },
{ "id" => 1, "method" => "POST", "to" => "/index/relationship/index2?unique", "body" => { "key" => "key2", "value" => "value2", "type" => "type2", "start" => "{0}", "end" => "{1}", "properties" => "properties" } }
]

connection.should_receive(:post).with("/batch", json_match(:body, expected_body))
subject.execute [:create_unique_relationship, "index1", "key1", "value1", "type1", "node1", "node2" ],
[:create_unique_relationship, "index2", "key2", "value2", "type2", "{0}", "{1}" ]
subject.execute [:create_unique_relationship, "index1", "key1", "value1", "type1", "node1", "node2","properties" ],
[:create_unique_relationship, "index2", "key2", "value2", "type2", "{0}", "{1}", "properties" ]
end

it "adds relationships to an index" do
Expand Down

0 comments on commit 39a9053

Please sign in to comment.