These suggestions should work for you, but you can also consider decoupling your selectors from your stories to make it easier to support your test suite and more expressive business value. For example: you can change the step to something like:
Then the post should be displayed as the current post
This is pretty easy to implement if you use Pickle :
Given the following posts exist:
| post | title | slug |
| Lorem | Lorem Ipsum Dolor | lorem-ispum-dolor |
| Hello | Hello World | hello-world |
When I go to the post page for post "Hello"
Then post "Hello" should be displayed as the current post
Then /^
post = model!(post_reference)
page.should have_css("li.current ##{dom_id(post)}")
end
source
share