I need some help with a regular expression in a Cucumber step definition file. Many of my steps are of the type:
Given I am on the search page
I use this general pattern for most of my step definitions, and use the default Webrat regex to pick it up that looks like this:
Given /^(?:|I )am on (.+)$/ do |page_name|
visit path_to(page_name)
end
The problem is that I need to handle a page titled 'results' differently, and I do not know how to modify the above regex to exclude lines that say 'Given I am on the results page' Can someone help me modify my above regex to