# Can't get  Test::Rails to work

**URL:** <https://discuss.rubyonrails.org/t/cant-get-test-rails-to-work/4645>\
**Category:** rubyonrails-talk\
**Created:** [November 16, 2006, 10:13pm UTC](https://discuss.rubyonrails.org/t/cant-get-test-rails-to-work/4645 "2006-11-16T22:13:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gitte\_Wange](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Gitte\_Wange](https://discuss.rubyonrails.org/u/Gitte_Wange)\
**Post date:** [November 16, 2006, 10:13pm UTC](https://discuss.rubyonrails.org/t/cant-get-test-rails-to-work/4645/1 "2006-11-16T22:13:55Z")

</div>

Hello,

I'm very happy with TDD and use it whereever possible. I came across Rails::Test and hoped to make even better tests easier. My problem is I haven't been able to run my tests ever since I made those 3 small changes to test\_helper.rb ☹

At first, I simply tried running rake test:functionals but it just gives me errors like: /Users/gitte/Projects/rtime/config/../app/controllers/billing\_controller.rb:3: undefined method `layout' for BillingController:Class (NoMethodError)

It's obvious to me what the error is - it's not obvious why. Have I missed something?

My test\_helper.rb looks like this: ENV["RAILS\_ENV"] = "test" require File.expand\_path(File.dirname(\_\_FILE\_\_) + "/../config/environment") require 'test/rails' require 'test\_help'

class Test::Rails::TestCase &nbsp;&nbsp;&nbsp;self.use\_transactional\_fixtures = false &nbsp;&nbsp;&nbsp;self.use\_instantiated\_fixtures = false

&nbsp;&nbsp;&nbsp;# Add more helper methods to be used by all tests here... end

Greetings,

Gitte Wange

---

<div class="post-metadata">

**Author:** ![Con](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Con](https://discuss.rubyonrails.org/u/Con)\
**Post date:** [November 16, 2006, 11:39pm UTC](https://discuss.rubyonrails.org/t/cant-get-test-rails-to-work/4645/2 "2006-11-16T23:39:05Z")

</div>

Hi, I highly recommend using the following for testing your rails application(s):

unit (test models) functional (test controller and model) integration (test across controllers and models)

Stub files are automatically generated for both controllers and models. Then you can easily use rake tasks to execute your tests. For example,

rake test → executes unit, functional, and integration

rake test:units → execute unit tests

rake test:functionals → execute functional tests

rake test:integration → execute integration tests

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![Gitte\_Wange](https://avatars.discourse-cdn.com/v4/letter/g/41988e/32.png) [@Gitte\_Wange](https://discuss.rubyonrails.org/u/Gitte_Wange)\
**Post date:** [November 17, 2006, 6:19pm UTC](https://discuss.rubyonrails.org/t/cant-get-test-rails-to-work/4645/3 "2006-11-17T18:19:56Z")

</div>

I've very familiar witht the stock testing framework in rails - I use it all the time for TDD 🙂I came across Test::Rails and wanted to try it out. It has some assertions for ajax stuff and a lot of other nifty things that I would like to benefit from. So I just wanted to know if anyone else had the same kind of problems with the module as I have 🙂

Greetings, Gitte Wange
