Ruby on Rails Saturday, December 25, 2010

daze wrote in post #970685:
[...]
>
> With regard to the idea about testing behavior alone:
>
> That makes a lot of sense. A lot. My question, however, is about how
> there must be a line to draw. If you were to test that the view has
> the content you want, wouldn't you HAVE to be testing implementation
> to an extent, as your view contains tags like e.g. <div class='span-5'
> id='main'>, and you'd be testing for e.g. a div with id 'main'?

Yes. That's not implementation in the sense that the user actually
*sees* it.

> It's
> just not clear to me how...

What part isn't clear?

>
>> (...) You should ideally be able
>> to change
>> your whole implementation and still have all your tests pass.
>
> Could you elaborate, maybe?

What do you need elaborated?

> Also, as I'm just getting started
> testing, I guess it's good to know now: Is it okay to use Shoulda and
> factory_girl_rails to handle all my testing? Or is rspec / cucumber
> absolutely necessary? (I don't feel like changing .... but I guess I
> need to know)

Use RSpec (or Shoulda) to test your models. Use Cucumber to test
user-facing behavior (don't bother with controller specs). Use Factory
Girl everywhere (Pickle helps it talk to Cucumber).

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

Sent from my iPhone

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment