2016-11-15 68 views
0

這裏有什麼問題?嘗試將以前作者的代碼(使用我的)與下面的步驟定義合併。在第一步定義中調用第一步%時出現以下錯誤。這個錯誤是說接收步驟定義需要兩個參數,即表和@name,它是在其他地方設置的,我只用表user_role值調用它。 #FAILS WITH:您的塊需要2個參數,但正則表達式匹配1個參數。塊需要2個參數,但正則表達式匹配1個參數

Then I make my person a user with role of "Peak Admin" in Peak 

When(/^I make my person a user with role of "([^"]*)" in Peak$/) do |role| 
    step %{I make my person a user in Peak 
    | user_role | role | } 
end 

Then(/^I make my person a user in Peak$/) do |table| 
    step %{I make the person "#{@name}" a user in Peak 
    | user_role | table.rows_hash[:user_role] |} 
end 

When(/I make the person "([^"]*)" a user in Peak$/) do |person,table| 
    .... 

回答

相關問題