[rspec-devel] [ rspec-Feature Requests-8001 ] separate out routing specs

noreply at rubyforge.org noreply at rubyforge.org
Sun Nov 18 21:08:04 EST 2007


Feature Requests item #8001, was opened at 2007-01-19 12:57
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8001&group_id=797

Category: rails plugin
Group: None
>Status: Closed
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: Nobody (None)
Summary: separate out routing specs

Initial Comment:
Routing happens outside of controllers and should be spec'able separately from controllers. This should be either part of a higher level integration spec or Story Runner, OR should be a new component category parallel w/ models, views, controllers and helpers.

Routing specs should support both route processing and route generation. For example:

route_for(:controller => "people", :action => "edit", :id => 1).should == "/people/1;edit"

AND

"/people/1;edit".should route_to(:controller => "people", :action => "edit", :id => 1)

The latter example would be extremely useful for custom mappings like this:

"/".should route_to(:controller => 'welcome')


----------------------------------------------------------------------

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 02:07

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/31-8001-separate-out-routing-specs#ticket-31-2

----------------------------------------------------------------------

Comment By: Rupert Voelcker (rupert)
Date: 2007-10-04 20:46

Message:
you can actually specify routes the other way round using params_from with the following syntax:

params_from(:get, '/people/1/edit').should == {:controller => "people", :action => "edit", :id => "1"}

although route_to is a bit more suggestive of what it does. Then perhaps route_from should be aliased to route_for so there's a route_to and a route_from.

----------------------------------------------------------------------

Comment By: Matt Scilipoti (mattscilipoti)
Date: 2007-10-04 17:00

Message:
+1.  This looks like a good format to me.

Note: On edge, url format has changed from "/people/1;edit" to "/people/1/edit"

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-01-19 16:34

Message:
I'd LOVE to take credit for it, but it comes from a comment by Eric Peden to [#6541]:

http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6541&group_id=797

Thanks for the idea Eric!

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-01-19 15:00

Message:
I LOVE that idea.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8001&group_id=797


More information about the rspec-devel mailing list