Powered By Blogger

segunda-feira, 9 de maio de 2011

Testing destroy methods with capybara

To test destroy controller methods with Capybara
you should load the current session driver the following 2 lines solve the confirmation and data-method="delete":


code:

rack_test_session_wrapper = Capybara.current_session.driver
rack_test_session_wrapper.process :delete, my_controller_path(@item)
#your destroy method path



source:http://blog.ardes.com/2010/4/28/capybara-and-rack-test-sessions-and-http-methods

Nenhum comentário:

Postar um comentário