[rspec-users] restful named routes
jerry.west at ntlworld.com
Thu Aug 16 13:04:35 EDT 2007
controller.send(:post_comments_path, @post).should ==
From: rspec-users-bounces at rubyforge.org
[mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan Linowes
Sent: 15 August 2007 21:03
Subject: [rspec-users] restful named routes
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
rspec-users mailing list
rspec-users at rubyforge.org
More information about the rspec-users