-
Notifications
You must be signed in to change notification settings - Fork 276
How To Test
Install a Neo4j test server
rake neo4j:install[community-2.1.3,test]
Configure it using a different server port e.g. 7475
rake neo4j:config[test,7475]
Edit the test configuration `config/environments/test'
config.neo4j.session_type = :server_db
config.neo4j.session_path = 'http://localhost:7475'
See example: Rails Blog Example
Faster, but does not do a complete clean of the database
Neo4j::Session.current._query('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r')
Works also in the embedded db.
Slower, Completely delete the database,
Include the require 'neo4j/tasks/neo4j_server'
in your Rakefile.
rake neo4j:reset_yes_i_am_sure[test]
Make sure you have installed a separate neo4j server test installation
Only for the embedded neo4j: stop embedded db, delete the db folder, start embedded db.
If you are using RSpec you can perform tests in a transaction as you would using active record. Just add the following to your rspec configuration in spec/rails_helper.rb
or spec/spec_helper.rb
config.around do |example|
Neo4j::Transaction.run do |tx|
example.run
tx.mark_failed
end
end
WARNING: Much of the information in this wiki is out of date. We are in the process of moving things to readthedocs
- Project Introduction
- Neo4j::ActiveNode
- Neo4j::ActiveRel
- Search and Scope
- Validation, Uniqueness, and Case Sensitivity
- Indexing VS Legacy Indexing
- Optimized Methods
- Inheritance
- Core: Nodes & Rels
- Introduction
- Persistence
- Find : Lucene
- Relationships
- Third Party Gems & extensions
- Scaffolding & Generators
- HA Cluster