ruby - Database Cleaner unable to detect ORM in Rails application -
the error below displayed when $ rspec
executed:
no known orm detected! activerecord, datamapper, sequel, mongomapper, mongoid, moped, or couchpotato, redis or ohm loaded? (databasecleaner::noormdetected)
this snippet spec_helper.rb file:
config.before(:suite) databasecleaner.strategy = :transaction databasecleaner.clean_with(:truncation) end
the rails application in question uses activerecord orm , documentation database cleaner states checks activerecord first.
the rails version application 5.0.0.beta2
.
what cause of error , how can fixed?
the cause:
the error caused absence of model. because there no model, no orm has been specified application. result, databasecleaner cannot choose appropriate strategy.
solution
at least 1 model should created. can done via rails generate scaffold
or rails generate model
commands.
Comments
Post a Comment