4

How can I get the test tasks back?

Backstory: I didn't start with the default new rails project. I'm using datamapper with dm-rails and used their boodstrap command:

rails new project_name -m http://datamapper.org/templates/rails.rb

My Rakefile is as follows:

require File.expand_path('../config/application', __FILE__)
require 'rake'

MyAppName::Application.load_tasks
Dylan Markow
  • 123,080
  • 26
  • 284
  • 201
Larsenal
  • 49,878
  • 43
  • 152
  • 220

1 Answers1

7

In a default Rails 3 project, config/application.rb contains require 'rails/all', basically requiring all of the rails frameworks (ActiveRecord, ActiveResource, ActionController, ActionMailer, TestUnit, etc.)

The DataMapper template changes this. Since it doesn't use ActiveRecord, it can't require 'rails/all' without causing problems. The only default Rails component it actually keeps is ActionController. It puts in require statements for ActiveResource, ActionMailer, and TestUnit, but comments them out by default.

Long story short: uncomment the following line in config/application.rb:

require 'rails/test_unit/railtie'
Dylan Markow
  • 123,080
  • 26
  • 284
  • 201