[rspec-users] route_to for ambiguous generation?

Clifford T. Matthews ctm at devctm.com
Tue Oct 13 11:35:11 EDT 2009

>>>>> "Randy" == Randy Harmon <r_j_h_box-sf at yahoo.com> writes:

    Randy> Hi Cliff, Hey, that's a good use case - one I hadn't
    Randy> considered.  Just goes to show you, the real world has a
    Randy> way of intruding on happy theories.  :) It's nice to hear
    Randy> feedback about the matcher.

It's so good that it makes my params_from hack too ugly!

    Randy> which_generates() as a method on the route_to() matcher
    Randy> seems like it should work to me, once it's written.  I
    Randy> don't generally wish to have two separate paths to the same
    Randy> content for publicly-accessible sites, because it's not as
    Randy> good for SEO, but there are certainly cases I can think of
    Randy> where that's irrelevant.

I thought about making it so that the only path to
SkillsController#index was through my root path, but that just struck
me as a bad compromise.  As for SEO, I try to do things the way I
think they should be done architecturally and then I just cross my
fingers and hope the search engine folks agree with me (eventually).

    Randy> I've had difficulty with my rspec-rails testing environment
    Randy> lately so it'd be difficult for me to quickly make the
    Randy> adjustment, but it does seem like it would be a simple
    Randy> change for someone who had strong motivation or easy
    Randy> access.

I added a which_generates call to my current test, cloned Rspec-rails,
added support for which_generates and pushed my results as a
proof-of-concept.  Unfortunately, the RSpec-rails testing isn't
working for me either right now and I have a huge queue of other
things to do before I can look at it.  I don't mind coming back and
making sure that I have a test for my new code, but it won't be for a
several hours at minimum and maybe a couple of days.
Cliff Matthews <ctm at devctm.com>

More information about the rspec-users mailing list