Skip to content

Commit

Permalink
add clean database method for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nickflux committed Mar 23, 2012
1 parent 3efc2b9 commit 7990f3c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/neography/rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,17 @@ def batch(*args)
options = { :body => batch.to_json, :headers => {'Content-Type' => 'application/json'} }
post("/batch", options)
end

###
# FOR TESTING
def clean_database(sanity_check = "not_really")
if sanity_check == "yes_i_really_want_to_clean_the_database"
delete("/cleandb/secret-key")
true
else
false
end
end

private

Expand Down Expand Up @@ -435,7 +446,7 @@ def evaluate_response(response)
@logger.error "Invalid data sent #{body}" if @log_enabled
nil
when 404
@logger.error "#{body}" if @log_enabled
@logger.error "Not Found #{body}" if @log_enabled
nil
when 409
@logger.error "Node could not be deleted (still has relationships?)" if @log_enabled
Expand Down

0 comments on commit 7990f3c

Please sign in to comment.