# Ruby on Rails 2.1 Unit Testing

**URL:** <https://www.ruby-forum.com/t/ruby-on-rails-2-1-unit-testing/140808>\
**Category:** Rails\
**Created:** [June 18, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-2-1-unit-testing/140808 "2008-06-18T19:59:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcmohd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mcmohd](https://www.ruby-forum.com/u/mcmohd)\
**Post date:** [June 18, 2008, 7:59pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-2-1-unit-testing/140808/1 "2008-06-18T19:59:46Z")

</div>

Hi,

Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most  
interesting one is Unit Testing of RoR Applications.

Just go through it and send me your comments.

> **[Ruby on Rails 2.1 - Unit Testing](http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-unit-testing.htm)**
>
> Ruby on Rails 2 1 Unit Testing - Before proceeding, let's have a quick look at a few definitions −

Thanks.

---

<div class="post-metadata">

**Author:** ![mcmohd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mcmohd](https://www.ruby-forum.com/u/mcmohd)\
**Post date:** [June 19, 2008, 12:21am UTC](https://www.ruby-forum.com/t/ruby-on-rails-2-1-unit-testing/140808/2 "2008-06-19T00:21:35Z")

</div>

Mc Mohd wrote:

> Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most  
> interesting one is Unit Testing of RoR Applications.
> 
> Just go through it and send me your comments.
> 
> [Ruby on Rails 2.1 - Unit Testing](http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-unit-testing.htm)

Tx! Now your verbiage has repeated a common misunderstanding.

test case: one ‘def test\_\*’ method that runs one event of testage  
test suite: a list of test cases with common setup & fixtures

the misunderstanding arises when a test suite inherits TestCase. This  
just means  
it follows the Interpreter Design - Suite 1–\>\* Suite 1–\>\* Case. The  
test  
runner instantiates the whole suite once for each time it runs one case.  
That  
helps Test Isolation…

Now test…

- some Views!
- some controllers from a misnamed suite. You need:

class WhateverTest \< ActiveController::TestCase  
tests MyController  
…
