Cucumber generates out some neat webrat regex steps. I encountered a problem when I tried the this.
In feature:
And I fill in "Telephone (Home)" with "61234567"
In webrat steps:
When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
fill_in(field, :with => value)
end
The error encountered:
Could not find field: "Telephone (Home)" (Webrat::NotFoundError)
It seems that the parenthesis between "Home" is giving problem. How do I tweak the regex to account for parenthesis?
UPDATE:
It seems that the regex wasn't the problem as the "field" instance variable did yield "Telephone (Home)". The real problem was the way webrat's "fill_in" method parses the field variable.