[rspec-devel] [ rspec-Feature Requests-6510 ] Named routes in controller specs

noreply at rubyforge.org noreply at rubyforge.org
Tue May 8 02:34:10 EDT 2007


Feature Requests item #6510, was opened at 2006-11-06 03:21
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6510&group_id=797

Category: rails plugin
Group: None
Status: Open
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: Nobody (None)
Summary: Named routes in controller specs

Initial Comment:
[from RFE 5719 - Jonathan del Strother]

Being able to use named routes would be extremely useful - eg  
"get accounts_url"
or
"delete account_url(@account)"
(though it's perhaps worth noting that this doesn't even work in Rails' functional tests - you have to use integration
tests if you want this to work)

(this is a dup of  6501, but I was unable to move it from tracker to tracker, so I deleted that one and added this one)

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

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-05-08 06:34

Message:
Doesn't this work now?

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

Comment By: David Goodlad (dgoodlad)
Date: 2007-03-01 20:20

Message:
I've just run into this issue, although it's because I'm trying to spec out my named routes. It seems that ActionController::Base's normal behavior of using the current url's options and merging them with whatever is generated in url_for doesn't work, since AC::Base needs to have @url set to do that.

I worked around the problem in this case by doing a simple 'get' on one of my actions in setup first, but this is an ugly solution. We should have a way of specifying that the controller's "current url" is already set to something...

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

Comment By: Rodrigo Kochenburger (divoxx)
Date: 2007-03-01 16:15

Message:
I think this must be fixed.
Mostly because having some redirect_to some_url in the controller will also break the spec.
So it's not really a spec needs, but controller execution need.

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

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


More information about the rspec-devel mailing list