Skip to content

Commit

Permalink
Add NodeRelationships return specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdvdijk committed Sep 8, 2012
1 parent 7456f9e commit 65ad592
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/unit/rest/node_relationships_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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|
Expand Down

0 comments on commit 65ad592

Please sign in to comment.