2011-12-13 25 views
1

我使用Ryan Bates頗爲可愛的nested form gem。它可以正常使用,但我沒有找到用黃瓜進行測試的方法。我沒有試圖測試寶石本身,而是在完成表格後我的網站的行爲。如何使用黃瓜測試使用nested_form gem的表單?

我使用的步驟與我在網站上使用的步驟完全相同。

Then I should see "Add a question"      # features/step_definitions/web_steps.rb:105 
When I follow "Add a question"       # features/step_definitions/web_steps.rb:56 
    You have a nil object when you didn't expect it! 
    You might have expected an instance of Array. 
    The error occurred while evaluating nil.[] (NoMethodError) 
+1

你在這個時候是否啓用了黃瓜的javascript引擎? – tal

回答

1

鑑於gem使用javascript來執行瀏覽器魔術,該場景需要@javascript標記。

現在正常工作。