Nicolás Sanguinetti
2010-Jan-04 19:16 UTC
[rspec-users] "RESTful" controller specs in rails
So, what''s the awesome sauce everyone is using for this? In the past I''ve used shared behaviors, and rspec_on_rails_on_crack to solve all the repetition in the controller specs, but I''ve been away from rspec for a while, and the controller specs in the rails project I''m working on are a mess. So? what''s the best/recommended approach these days? Cheers, -foca
I use resource_controller, and then don''t need to write controller specs because it''s all boiler-plate. If I add any custom behavior that needs more focused testing than cucumber provides, I can just write a couple specs to cover it. Pat On Jan 4, 2010, at 11:16 AM, Nicol?s Sanguinetti wrote:> So, what''s the awesome sauce everyone is using for this? In the past > I''ve used shared behaviors, and rspec_on_rails_on_crack to solve all > the repetition in the controller specs, but I''ve been away from rspec > for a while, and the controller specs in the rails project I''m working > on are a mess. So? what''s the best/recommended approach these days? > > Cheers, > -foca > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 4 Jan 2010, at 22:46, Pat Maddox wrote:> I use resource_controller, and then don''t need to write controller specs because it''s all boiler-plate. If I add any custom behavior that needs more focused testing than cucumber provides, I can just write a couple specs to cover it.Ditto: I use resources_controller (note different name!), which already has comprehensive tests, and only write specs for any non-boilerplate behaviour which I add. Cheers, -Tom