functional, integration and uni tests: when, what?

john wrote:

hi, I've just a doubt about this tests. When (/for what) use for example functional tests instead of integration tests o r unit tests? Can someone explain me this? :slight_smile: thanks

I think it's down to a matter of taste to a fair degree (as the discussion at the London RailsConf demonstrated with core members taking different views. I *prefer* to use functional tests for well defined, encapsulated actions (and they seem to work nicely with REST perhaps for this reason).

On the other hand integration tests seem to work better either with a story based approach, or where you are testing a more complicated scenario.

Unit tests, however, are my favourite -- particularly now that I've embraced the skinny controller fat model approach -- as I like as much of the action to be handled at model level.

Just my $0.02