Skip to content

Commit

Permalink
Fixed error test
Browse files Browse the repository at this point in the history
Needed to specify which error in the spec. Fixed code so it works properly with the correct error now
  • Loading branch information
digitalbias committed Feb 1, 2013
1 parent ff61391 commit dc99e62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/neography/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ def evaluate_response(response)
end

def handle_4xx_500_response(code, body)
if body
parsed_body = JSON.parse(body)
message = parsed_body["message"]
stacktrace = parsed_body["stacktrace"]
else
if body.nil? or body == ""
parsed_body = {}
message = "No error message returned from server."
stacktrace = ""
else
parsed_body = JSON.parse(body)
message = parsed_body["message"]
stacktrace = parsed_body["stacktrace"]
end

@logger.error "#{code} error: #{body}" if @log_enabled
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/rest_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
@neo.add_node_to_index("test_node_index", key, value, new_node)
new_index = @neo.get_node_index("test_node_index", key, value)
new_index.should_not be_nil
expect { @neo.remove_node_from_index("test_node_index", key, "", new_node) }.to raise_error
expect { @neo.remove_node_from_index("test_node_index", key, "", new_node) }.to raise_error Neography::NeographyError
end
end

Expand Down

0 comments on commit dc99e62

Please sign in to comment.