[cucumber] Nested resource in paths.rb


#1

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

#2

On Sun, Apr 5, 2009 at 10:40 PM, GMin, Morten K. Holst
removed_email_address@domain.invalidwrote:

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/78ba010b4b7186675841fbd4cc57a60a50686221

Aslak