Skip to content

Commit

Permalink
fixing issue 114
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Oct 30, 2013
1 parent 619ffeb commit 8d1a370
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/neography/rest/paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def build_path(path, attributes)
end

def encode(value)
URI.encode(value).gsub("/","%2F")
CGI.escape(value).gsub("+", "%20")
end

end
Expand Down
8 changes: 8 additions & 0 deletions spec/integration/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
existing_node.name.should == value
end

it "can find a node in an index with brackets" do
value = "Sen. Roy Blunt [R-MO]"
new_node = Neography::Node.create("name" => value)
new_node.add_to_index("node_test_index", "name", value)
existing_node = Neography::Node.find("node_test_index", "name", value)
existing_node.name.should == value
end

it "can find a relationship in an index" do
value = generate_text
node1 = Neography::Node.create
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/rest/node_relationships_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Rest
end

it "gets relationships with direction and types" do
connection.should_receive(:get).with("/node/42/relationships/in/foo&bar")
connection.should_receive(:get).with("/node/42/relationships/in/foo%26bar")
subject.get("42", :in, ["foo", "bar"])
end

Expand Down

0 comments on commit 8d1a370

Please sign in to comment.