Forum: RSpec Using resource_controller (make_resourceful etc) and testing them

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.
85d99e7678d8720f6e00ab0f60fe6ea9?d=identicon&s=25 Andrew Premdas (Guest)
on 2008-12-11 12:52
(Received via mailing list)
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
C694a032be7518a0d704318895f8fe1d?d=identicon&s=25 Ben Mabey (mabes)
on 2008-12-11 19:19
(Received via mailing list)
Andrew Premdas wrote:
> _______________________________________________
> rspec-users mailing list
> rspec-users@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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2008-12-11 20:04
(Received via mailing list)
Ben Mabey <ben@benmabey.com> writes:

>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users@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
85d99e7678d8720f6e00ab0f60fe6ea9?d=identicon&s=25 Andrew Premdas (Guest)
on 2008-12-11 21:49
(Received via mailing list)
Thanks for that Ben most helpful.

2008/12/11 Ben Mabey <ben@benmabey.com>
F86901feca747abbb5c6c020362ef2e7?d=identicon&s=25 Zach Dennis (zdennis)
on 2008-12-12 00:05
(Received via mailing list)
On Thu, Dec 11, 2008 at 1:19 PM, Ben Mabey <ben@benmabey.com> wrote:
>> ------------------------------------------------------------------------
> 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
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-05-21 21:17
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
5 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
This topic is locked and can not be replied to.