[rspec-users] Testing routes with a prefix

Justin Ko jko170 at gmail.com
Wed Mar 23 13:43:34 EDT 2011


On Wed, Mar 23, 2011 at 10:16 AM, Radhesh Kamath <lists at ruby-forum.com>wrote:

> Justin Ko wrote in post #988825:
> > On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath
> > <lists at ruby-forum.com>wrote:
> >
> >>  end
> >>
> >> rspec-users at rubyforge.org
> >> http://rubyforge.org/mailman/listinfo/rspec-users
> >>
> >
> >
> > You're mapping absolute strings (URL's) to your routes. Any string
> > manipulation would dilute the spec. In my opinion, this is not a case of
> > keeping things DRY.
>
> It's clear that you have understood my intent: keep things DRY by
> specifying the prefix once, and write tests as though the prefix is
> implicitly specified.
>
> But what do you mean by 'dilute the spec'?
> Do you think it might make the spec brittle?
>

Routes are basically constants. By breaking this constant up (the string) in
your spec, the value drops (because of clarity), in my opinion.


>
> Pat:
>
> I just want to keep things DRY by specifying the 'v1' prefix once, so
> the example would be 'v1/...', only 'v1' would be implicitly set in some
> way.
>
> Best,
> Radhesh
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> 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/20110323/2ecdafe5/attachment.html>


More information about the rspec-users mailing list