diff --git a/spec/unit/rest/node_relationships_spec.rb b/spec/unit/rest/node_relationships_spec.rb index fb3fe37..2c8da00 100644 --- a/spec/unit/rest/node_relationships_spec.rb +++ b/spec/unit/rest/node_relationships_spec.rb @@ -17,6 +17,12 @@ class Rest subject.create("some_type", "42", "43", {:foo => "bar", :baz => "qux"}) end + it "returns the post results" do + connection.stub(:post).and_return("foo") + + subject.create("some_type", "42", "43", {}).should == "foo" + end + it "gets relationships" do connection.should_receive(:get).with("/node/42/relationships/all") subject.get("42") @@ -37,6 +43,16 @@ class Rest subject.get("42", :in, ["foo", "bar"]) end + it "returns nil if no relationships were found" do + connection.stub(:get).and_return(nil) + subject.get("42", :in).should be_nil + end + + it "returns nil if no relationships were found by type" do + connection.stub(:get).and_return(nil) + subject.get("42", :in, "foo") + end + context "directions" do [ :incoming, "incoming", :in, "in" ].each do |direction|