So, I think it would be cool to have in the stories another level aka Chapter. Think even nested chapters. I could look like that.
Story "an item live-story" do
Chapter "items index" do
Given "two items"
Scenario "anonymous gets the index" do
Given "an anonymous user"
When "he GET /items"
Then "he should be redirected to the login_path"
end
Scenario "registered user gets the index" do
Given "a logged in user"
When "he GET /items"
Then "he should see the 'items/index' page"
And "both items should be on the page"
end
Then "something in common happens"
end
end
The idea is that the chapters were working like scopes for the inside subchapters and scenarios. You may specify there common givens and thens which will be applied to the internal parts. May be it could be useful to be able to attach additional steps for particular chapters.
No comments:
Post a Comment