9. PATHS
# paths.rb
# When I go to the list of articles
def path_to(page_name)
case page_name
when /the list of articles/
articles_path
end
end
10. BACKGROUND
# manage_articles.feature
Background:
Given the following user records
| username | password | admin |
| bob | secret | false |
| admin | secret | true |
Scenario: Protect articles from regular users
Given I am logged in as "bob"
When I visit the list of articles
And I press "Delete all"
Then I should see "Sorry you cannot do that"
Scenario: Delete articles as admin
Given I am logged in as "bob"
When I visit the list of articles
And I press "Delete all"
Then I should see "Articles deleted”