diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 17e5206..3789b40 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -9,4 +9,7 @@ Contributors: * Stephen Becker IV * Thomas Baum * Maximilian Schulz -* Hesham Amiri \ No newline at end of file +* Hesham Amiri +* Pablo Fernandez +* Nick Reavill +* Marcel Sherf diff --git a/lib/neography/rest.rb b/lib/neography/rest.rb index 955ce38..a42efdb 100644 --- a/lib/neography/rest.rb +++ b/lib/neography/rest.rb @@ -427,7 +427,7 @@ def get_batch(args) when :get_relationship_index {:method => "GET", :to => "/index/relationship/#{args[1]}/#{args[2]}/#{args[3]}"} when :get_node_relationships - {:method => "GET", :to => "/node/#{get_id(args[1])}/relationships/#{args[2]}"} + {:method => "GET", :to => "/node/#{get_id(args[1])}/relationships/#{args[2] || 'all'}"} else raise "Unknown option #{args[0]}" end diff --git a/lib/neography/tasks.rb b/lib/neography/tasks.rb index 639c317..46edd0c 100644 --- a/lib/neography/tasks.rb +++ b/lib/neography/tasks.rb @@ -4,7 +4,7 @@ namespace :neo4j do desc "Install Neo4j" task :install, :edition, :version do |t, args| - args.with_defaults(:edition => "community", :version => "1.7.M01") + args.with_defaults(:edition => "community", :version => "1.7.M02") puts "Installing Neo4j-#{args[:edition]}-#{args[:version]}" if OS::Underlying.windows? diff --git a/spec/integration/rest_batch_spec.rb b/spec/integration/rest_batch_spec.rb index 2e9d2d8..2f34abd 100644 --- a/spec/integration/rest_batch_spec.rb +++ b/spec/integration/rest_batch_spec.rb @@ -311,6 +311,24 @@ [:add_relationship_to_index, "test_relationship_index", key, value, "{4}"] batch_result.should_not be_nil end + + it "can get multiple relationships" do + node1 = @neo.create_node + node2 = @neo.create_node + node3 = @neo.create_node + new_relationship1 = @neo.create_relationship("friends", node1, node2) + new_relationship2 = @neo.create_relationship("brothers", node1, node3) + batch_result = @neo.batch [:get_node_relationships, node1] + batch_result.first["body"][0]["type"].should == "friends" + batch_result.first["body"][0]["start"].split('/').last.should == node1["self"].split('/').last + batch_result.first["body"][0]["end"].split('/').last.should == node2["self"].split('/').last + batch_result.first["body"][0]["self"].should == new_relationship1["self"] + batch_result.first["body"][1]["type"].should == "brothers" + batch_result.first["body"][1]["start"].split('/').last.should == node1["self"].split('/').last + batch_result.first["body"][1]["end"].split('/').last.should == node3["self"].split('/').last + batch_result.first["body"][1]["self"].should == new_relationship2["self"] + end + end end \ No newline at end of file