RSpec

5 views
Skip to first unread message

MartOn

unread,
Apr 23, 2009, 2:22:54 AM4/23/09
to Hobo Users
Any1 using rspec with Hobo?

Would be nice to see how you a generating the rspec part of the code.

/MartOn

adamski

unread,
Apr 23, 2009, 7:57:21 AM4/23/09
to Hobo Users
Also interested in seeing how people test with Hobo, RSpec and
otherwise. It is a highly neglected area of our project and we need to
implement a lot more than our current unit tests.

Bryan Larsen

unread,
Apr 23, 2009, 9:15:20 AM4/23/09
to Hobo Users
If you're following Rails conventions, most of your business logic
probably lives in your models. I find model testing is the easiest
thing to test in Rails. And Hobo doesn't change this in any way. The
only thing you're missing is the generators: script/generate
rspec_scaffold generates rspec but not Hobo, and hobo_model_controller
generates Hobo but not rspec.

What I do is just generate rspec_model on a dummy model and then
convert it into a test for a Hobo model.

If I was starting a new project now, I'd probably use Test::Unit with
shoulda.

I tend not to do controller or view testing because there usually
isn't enough logic in them to make them worth the trouble.

If you create any non-trivial tag, it should be tested -- either with
a view test or an integration test. For examples of integration
tests, there is a simple Webrat based tests here:
http://github.com/tablatom/agility/blob/master/test/integration/filter_menu_test.rb.
There's a Selenium test here: http://github.com/tablatom/agility/blob/master/test/selenium/populate.rsel
and there are more here: http://github.com/tablatom/agility/tree/jquery-test/test/selenium

cheers,
Bryan
Reply all
Reply to author
Forward
0 new messages