Reputation: 21618
Below code passes an argument to a cucumber step definitions:
Then /^I should see a message "([^\"]*)"$/ do |arg1|
page.should have_content (arg1)
end
Anyone could help me, how to pass multiple arguments?
Upvotes: 1
Views: 3912
Reputation: 51697
In order to pass multiple arguments, you need to have multiple "capture groups". Here's an example that has two capture groups:
Then /^I should see a message "([^\"]*)" and another message "([^\"]*)" $/ do |arg1, arg2|
page.should have_content(arg1)
page.should have_content(arg2)
end
Upvotes: 5