有誰知道爲什麼我會收到以下錯誤,當我使用web_step#follow方法?黃瓜的web_step#遵循使用水豚產生NameError
When I follow "Stuff" within "#main-nav" # features/step_definitions/web_steps.rb:33
undefined local variable or method `node' for #<Capybara::Driver::RackTest::Node:0x00000101409b40> (NameError)
./features/step_definitions/web_steps.rb:35:in `block (2 levels) in <top (required)>'
./features/step_definitions/web_steps.rb:14:in `block in with_scope'
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:34:in `/^(?:|I)follow "([^"]*)"(?: within "([^"]*)")?$/'
這是HTML輸出:
<ul id='main-nav'>
<li><a href="/things">Things</a></li>
<li><a href="/stuff">Stuff</a></li>
</ul>
P.S.我已經刪除了webrat,並且完全使用水豚
在此先感謝!
如果您顯示您正在使用的*實際*代碼,以便我們都調試相同的問題,這將非常有幫助。 – 2011-04-03 03:08:42