Forum: Ruby on Rails Testing your Controller, using RSpec

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B7cdfb10784a567f76f3cb79d531cd4c?d=identicon&s=25 torm3nt (Guest)
on 2008-11-05 05:54
(Received via mailing list)
If anyone is interested, I've written up a fairly basic tutorial going
over testing some features of your controllers, using RSpec. Am
looking for comments/constructive criticism on the article and if
there's anything you'd like to see me write, am all ears! :)

Article is here:
http://www.kirkbushell.com/articles/testing-using-...


Enjoy, and feel free to comment!
2d8132658d56e51f19ace1c68e48b6aa?d=identicon&s=25 Thorsten Mueller (thorsten)
on 2008-11-05 12:26
(Received via mailing list)
Looks really good for a start.

Depending on the knowledge of the intended audience it may help
some people if you would explain what stubbing means. It's an
important
concept of rspec and extremely helpful in many situations. Could
even get it's own chapter.
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2008-11-05 12:32
A few issues:

- You talk about TDD at its primitive finest, but you actually wrote
code before the specs...

- describe :login is not a clear description

- Your users_controller is not designed restfully

- The way you set session[:user] in the controller uses bad coding
practice


Beside that, trying to teach people is also a good way to learn.
This topic is locked and can not be replied to.