As I don't think I can give a truly new answer, I will link to my answer from a previous question which was somewhat similar stackoverflow.com/questions/1448821/…. My answer was also edited by Mr. Topley, like your question :)
–
theIVAug 25 '10 at 9:14

2 Answers
2

The actual decision as to "how" is easy, but "how much" can be a difficult to answer.

I have a couple of small (almost but not quite legacy) projects with next to no tests, and the tests tend to be low-level unit tests of crucial components in the code. On occasion I wish they had more tests, but in general they are thrown together with quite small surface areas that make debugging and manual testing pretty straight forward.

In my day job, we're using rSpec, Cucumber and Selenium on a fairly large Rails project (10+ developers, several years in the making).

rSpec provides unit coverage for all our models, controllers, helpers and other classes.

Cucumber provides higher-level functional and integration tests.

Selenium is used to excercise javascript-intensive areas of our UI with javascript (running through Capybara and Cucumber). We also have a suite of regression tests in Selenium used by our Test and QA team (versions released to QA are green-lit through our CI build).

My "bare-minimum" setup these days would be unit-level coverage using rSpec on the critical and/or complex areas and a full suite of functional Cucumber tests on the critical paths through the application.

There are many tools for testing rails and other webapps from many different aspects. But if you are new to testing I highly recommend you start with learning Rails own testing framework before start using other tools.

Learning, and later mastering, one testing framework makes it easier in the future to understand pros/cons with other framework and make them work in unison.

You could start with testing the following things:

Unit Testing your Models

Functional Tests for Your Controllers

Learning about Fixtures and how to load test data

I have seen many failed testing efforts, but I never saw them fail because they choose the wrong tool/framework. They fail because they don't know how to master the tools they use, and learn enough about the basics about testing.

Manual Exploratory Testing
As much as I love automated testing it is, IMHO, not a substitute for manual testing. The main reason being that an automated can only do what it is told and only verify what it has been informed to view as pass/fail. A human can use it's intelligence to find faults and raise questions that appear while testing something else.
Read more about mixing Automated and Manual Testing in another of my answers here:What test methods do you use for developing websites?