This project is archived and is in readonly mode.
[PATCH] Generators create tests with require 'test_helper' which doesn't work.
Reported by Brian Hogan | May 12th, 2008 @ 04:31 AM
The generators all create tests that use
require 'test_helper'
Howegver, when you run the tests in TextMate or at the command-line via ruby test/units/foo_test.rb, the tests cannot load the file. This patch restores the original line which loads the test_helpers correctly.
require File.dirname(__FILE__) + '/../test_helper'
This addresses
.../controller/templates/functional_test.rb
.../integration_test/templates/integration_test.rb
.../components/mailer/templates/unit_test.rb
.../components/model/templates/unit_test.rb
.../components/observer/templates/unit_test.rb
.../resource/templates/functional_test.rb
.../scaffold/templates/functional_test.rb
Hopefully I got them all.
Comments and changes to this ticket
-
Jeremy Kemper May 12th, 2008 @ 07:08 AM
- State changed from new to invalid
Include the test dir in the load path: ruby -Itest test/units/foo_test.rb
Or invoke the test via the test task: rake TEST=test/units/foo_test.rb
-
Ryan Bigg October 11th, 2010 @ 10:55 AM
- Tag cleared.
- Importance changed from to Low
Automatic cleanup of spam.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>