2015-02-12 133 views
0

需要一些帮助来摆脱此错误。无法通过黄瓜这一步。使用黄瓜步骤定义时的模糊匹配

And I fill in "Email" with "[email protected]"    # features/developer_registration.feature:9 
     Ambiguous match of "I fill in "Email" with "[email protected]"": 

     features/step_definitions/developer_steps.rb:9:in `/^I fill in "(.*?)" with "(.*?)"$/' 
     features/step_definitions/developer_steps.rb:31:in `/^I fill in "(.*?)" with "(.*?)"$/' 

这部分在steps.rb处理这一步。

When(/^I fill in "(.*?)" with "(.*?)"$/) do |email, password| 


    fill_in "[email protected]", with: email # express the regexp above with the code you wish you had 
    fill_in "1", with: password 

end 

回答

0

我修改了代码,如下所示,它按要求工作。

When(/^I fill in Email with "(.*?)"$/) do |email| 
    fill_in "EMAIL", with: email # express the regexp above with the code you wish you had 
end 
1

根据输出结果,您可以定义相同的步骤。一旦在第9行,另一个在第31行。你只显示了其中一个定义。

检查这两行的定义,你很可能会发现问题的根源。