2012-11-24 72 views

回答

5

爲了傳遞多個參數,您需要有多個「捕獲組」。以下是一個具有兩個捕獲組的示例:

Then /^I should see a message "([^\"]*)" and another message "([^\"]*)" $/ do |arg1, arg2| 
    page.should have_content(arg1) 
    page.should have_content(arg2) 
end