[rspec-users] restful named routes
jonathan at parkerhill.com
Wed Aug 15 16:02:31 EDT 2007
revisiting this issue, I feel I'm getting closer:
describe CommentsController, "named routes" do
@post = mock_model(Post, :id => 22)
it "should generate post_comments_path" do
controller.post_comments_path(@post).should == "/posts/22/comments"
NoMethodError in 'CommentsController named routes should generate
protected method `post_comments_path' called for #<CommentsController:
Is there a way around this?
Or how are other testing named routes?
On May 29, 2007, at 7:52 AM, Scott Taylor wrote:
> On May 29, 2007, at 4:54 AM, Jonathan Linowes wrote:
>> - Is there a way to test named routes?
> I don't think there is a very clean & direct way (hopefully the
> others on the list can correct me). The rspec rest generator
> generates some code to check the routes, so you could use something
> like that.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users