-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6db5b23
commit 739befe
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Neography | ||
class Rest | ||
class RelationshipTypes < Properties | ||
extend Neography::Rest::Paths | ||
|
||
add_path :all, "/relationship/types" | ||
|
||
def list | ||
@connection.get(all_path) | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'spec_helper' | ||
|
||
describe Neography::Rest do | ||
before(:each) do | ||
@neo = Neography::Rest.new | ||
end | ||
|
||
describe "list relationship types" do | ||
it "can get a listing of relationship types" do | ||
new_node1 = @neo.create_node | ||
new_node2 = @neo.create_node | ||
new_relationship = @neo.create_relationship("friends", new_node1, new_node2) | ||
rel_types = @neo.list_relationship_types | ||
rel_types.should_not be_nil | ||
rel_types.should include("friends") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'spec_helper' | ||
|
||
module Neography | ||
class Rest | ||
describe RelationshipTypes do | ||
|
||
let(:connection) { stub(:configuration => "http://configuration") } | ||
subject { RelationshipTypes.new(connection) } | ||
|
||
it "lists all relationship types" do | ||
connection.should_receive(:get).with("/relationship/types") | ||
subject.list | ||
end | ||
end | ||
end | ||
end |