search for: models_no_db

Displaying 1 result from an estimated 1 matches for "models_no_db".

2007 Feb 23
0
Using rspec_on_rails without a test
Looks like you can run rspec w/out hitting the database by doing the following: 1. Setting up a new rake task which does not have db:test:prepare as a dependency: namespace :spec do desc "Run the specs under spec/models without a database" Spec::Rake::SpecTask.new(:models_no_db) do |t| t.spec_opts = [''--options'', "\"#{RAILS_ROOT}/spec/spec.opts\""] t.spec_files = FileList[''spec/models/**/*_spec.rb''] end end 2. Calling an error on access the database with a new helper: ENV["RAILS_ENV"] = &quo...