[rspec-users] My very fist spec file (not sure what's wrong..)

Stephen Eley sfeley at gmail.com
Wed Jul 22 01:15:35 EDT 2009


2009/7/22 internetchris <chris at silhouettesolutions.net>:
>
> So if that's the case is the main use of rspec within a rails app for
> the model and validation testing?

For a lot of people, yes.  It's certainly a fair generalization that
model specs are the easiest and most straightforward specs in Rails.
If you're applying MVC well, most of the "interesting" stuff should be
in the models anyway -- that's where your business logic ought to
live.  The fundamental work that gives your app a reason to exist.  It
so happens that business rules are also easier to specify than HTML
interfaces (views) or interface setup and dispatching code
(controllers).  So it tends to attract more testing focus.

There are a lot of ways to strike a good balance, though.  And adding
Cucumber and Webrat (and maybe Selenium, Celerity, Javascript test
frameworks, etc.) to the mix makes for even more variations.  "There
are nine-and sixty ways of constructing tribal lays..."

Best of luck to you.


Have Fun, ("And--every--single--one--of--them--is--RIGHT!")
   Steve Eley (sfeley at gmail.com)
   ESCAPE POD - The Science Fiction Podcast Magazine
   http://www.escapepod.org


More information about the rspec-users mailing list