[rspec-users] [cucumber] Nested resource in paths.rb

aslak hellesoy aslak.hellesoy at gmail.com
Mon Apr 6 04:34:09 EDT 2009

On Sun, Apr 5, 2009 at 10:40 PM, GMin, Morten K. Holst <morten at gmin.org>wrote:

> Hello Rspec Users,
> I was wondering how you specify a nested resource in cucumber. So for
> example:
> Given I have a blogpost titled Question For Nice Rspec Users
> When I am on the list of comments for Question For Nice Rspec Users
> Then I should see "Answer"
> Now, as one might expect, blogpost has_many :comments, so my question is
> this:
> How should I write the "when-case" for "the list of comments for Question
> For Nice Rspec Users" in paths.rb?

You shouldn't. It wasn't meant for that. I just wrote a more detailed
explanation (and tip) in RDoc:



> What I'm asking about in particular is how to extract the "Question For
> Nice Rspec Users" part and use it to find the blogpost I created earlier and
> thus generate the path from a nested route e.g. comments_path(blogpost).
> Many thanks in advance.
> - Morten
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090406/64a20286/attachment.html>

More information about the rspec-users mailing list