oskbor
oskbor

Reputation: 1592

How to test neo4j.rb models with RSpec in rails?

I am trying out rails, neo4j.rb and rspec for the first time, so perhaps this has a very simple solution for you knowledgeable people. This is basically what I did:

(I am using jruby)
rails new graphtest -m http://andreasronge.github.com/neo4j/rails.rb
cd graphtest
bundle
rails generate model testnode
rails generate rspec:install
rspec spec/models/testnode_spec.rb

and then I get this error when running rspec: NoMethodError: undefined method 'active_record' for #<Rails::Application::Configuration:0x15071f28>

I was under the impression that the neo4j.rb gem implemented active_record. I did try to include active record in various places but I never got around this error message. What to do?

regards

Upvotes: 1

Views: 684

Answers (1)

Andreas Ronge
Andreas Ronge

Reputation: 321

Neo4j.rb does implement a small subset of the Active Record API. You should make sure that your application does not require active record or tries to configure active record. Not sure who adds that dependency to active record (rspec:install ?), but the rails new graphtest -m ... should work out of the box and does not have any dependencies to active record.

Upvotes: 2

Related Questions