Andrew Premdas
2008-Dec-11 11:52 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and testing them
Hi all, Trying to get some opinions about the use of such plugins and in particular about how they test, and how we test with them. Can they work well with BDD or do they do to much magic and create difficulties for features and tests TIA -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081211/b7bddbb9/attachment-0001.html>
Ben Mabey
2008-Dec-11 18:19 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and testing the
Andrew Premdas wrote:> Hi all, > > Trying to get some opinions about the use of such plugins and in > particular about how they test, and how we test with them. Can they > work well with BDD or do they do to much magic and create difficulties > for features and tests > > TIA > ------------------------------------------------------------------------ > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersHey Andrew, Controllers using such plugins should not pose any difficulty wrapping features around them at all. How are they any different from any other controller from the request point-of-view? My current thinking on the matter is this: Use features, but skip the controller specs. The features verify the actual behaviour of them alongside the rest of the stack and provide me with the best confidence that I''m using the plugin correctly and giving the end-users the functionality that the app needs to. I don''t see controller specs adding any additional value at this point. We would simply be testing the plugin''s code over and over again... There is also no design benefit from mocking/stubbing the plugins code either. That is what I have been doing for all the standard RESTful actions. If I ever need to vary from the basic behaviour that is provided from the plugins then I then start adding controller specs for that deviating behaviour. At which point I will stub out what I need to to make the plugin work. HTH, Ben
Pat Maddox
2008-Dec-11 19:03 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and testing the
Ben Mabey <ben at benmabey.com> writes:> Andrew Premdas wrote: >> Hi all, >> >> Trying to get some opinions about the use of such plugins and in >> particular about how they test, and how we test with them. Can they >> work well with BDD or do they do to much magic and create >> difficulties for features and tests >> >> TIA >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >>My current thinking on the matter is this: Use features, but skip the >controller specs. The features verify the actual behaviour of them >alongside the rest of the stack and provide me with the best confidence >that I''m using the plugin correctly and giving the end-users the >functionality that the app needs to. I don''t see controller specs >adding any additional value at this point. We would simply be testing >the plugin''s code over and over again... There is also no design >benefit from mocking/stubbing the plugins code either.+2 Pat
Andrew Premdas
2008-Dec-11 20:47 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and testing the
Thanks for that Ben most helpful. 2008/12/11 Ben Mabey <ben at benmabey.com>> Andrew Premdas wrote: > >> Hi all, >> >> Trying to get some opinions about the use of such plugins and in >> particular about how they test, and how we test with them. Can they work >> well with BDD or do they do to much magic and create difficulties for >> features and tests >> >> TIA >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > Hey Andrew, > Controllers using such plugins should not pose any difficulty wrapping > features around them at all. How are they any different from any other > controller from the request point-of-view? My current thinking on the > matter is this: Use features, but skip the controller specs. The features > verify the actual behaviour of them alongside the rest of the stack and > provide me with the best confidence that I''m using the plugin correctly and > giving the end-users the functionality that the app needs to. I don''t see > controller specs adding any additional value at this point. We would simply > be testing the plugin''s code over and over again... There is also no design > benefit from mocking/stubbing the plugins code either. > That is what I have been doing for all the standard RESTful actions. If I > ever need to vary from the basic behaviour that is provided from the plugins > then I then start adding controller specs for that deviating behaviour. At > which point I will stub out what I need to to make the plugin work. > HTH, > Ben > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081211/3819804d/attachment.html>
Zach Dennis
2008-Dec-11 23:04 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and testing the
On Thu, Dec 11, 2008 at 1:19 PM, Ben Mabey <ben at benmabey.com> wrote:> Andrew Premdas wrote: >> >> Hi all, >> >> Trying to get some opinions about the use of such plugins and in >> particular about how they test, and how we test with them. Can they work >> well with BDD or do they do to much magic and create difficulties for >> features and tests >> >> TIA >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > Hey Andrew, > Controllers using such plugins should not pose any difficulty wrapping > features around them at all. How are they any different from any other > controller from the request point-of-view? My current thinking on the > matter is this: Use features, but skip the controller specs. The features > verify the actual behaviour of them alongside the rest of the stack and > provide me with the best confidence that I''m using the plugin correctly and > giving the end-users the functionality that the app needs to. I don''t see > controller specs adding any additional value at this point. We would simply > be testing the plugin''s code over and over again... There is also no design > benefit from mocking/stubbing the plugins code either. > That is what I have been doing for all the standard RESTful actions. If I > ever need to vary from the basic behaviour that is provided from the plugins > then I then start adding controller specs for that deviating behaviour. At > which point I will stub out what I need to to make the plugin work.+1 -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
Fernando Perez
2009-May-21 19:17 UTC
[rspec-users] Using resource_controller (make_resourceful etc) and tes
Andrew Premdas wrote:> Hi all, > > Trying to get some opinions about the use of such plugins and in > particular > about how they test, and how we test with them. Can they work well with > BDD > or do they do to much magic and create difficulties for features and > tests5 months after the initial post, any experience to share? I am about to use one of these plugins in order to simplify my admin controllers code. Thanks for your feedback -- Posted via http://www.ruby-forum.com/.