Forum: RSpec [cucumber] Nested resource in paths.rb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
54b84bc8fac4934507616be6c6fabd08?d=identicon&s=25 GMin, Morten K. Holst (Guest)
on 2009-04-06 03:15
(Received via mailing list)
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?

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
0be0e4aa42aacd9a8a95c792de273ca7?d=identicon&s=25 Aslak Hellesøy (aslakhellesoy)
on 2009-04-06 10:59
(Received via mailing list)
On Sun, Apr 5, 2009 at 10:40 PM, GMin, Morten K. Holst
<morten@gmin.org>wrote:

>
> 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:

http://github.com/aslakhellesoy/cucumber/commit/78...

Aslak
This topic is locked and can not be replied to.