I trying to learn BDD way for development and just watched RailsCasts lesson for Cucumber. There i’ve seen approach to describe some actions like:
When I go to the list of articles
Then I should see "Pizza"
And, as i understand all those “I go to” and “I should see” constructions hardcoded somewhere. So in paths.rb i can write:
def path_to(page_name)
case page_name
when /the list of articles/
articles_path
And it’ll recognize this path next time automaticaly. And “i should see” has same feature.
So, the question: is there ant way to replace those “I go to” and “I should see” constructions with another language or custom sequences? For example:
When I constantly visiting the list of articles
Then I have to observe text "Pizza"
Sure,
Cucumber uses the steps in web_steps.rb to make the call to the mapping. It looks like:
So, I would write the following step that redirect to the standard web_steps …
Hope this helps.