Ruby on Rails 2.1 Unit Testing

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.

http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-unit-testing.htm

Thanks.

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.

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
...