IMPORTANT: Per accedir als fitxer de subversion: http://acacha.org/svn (sense password). Poc a poc s'aniran migrant els enllaços. Encara però funciona el subversion de la farga però no se sap fins quan... (usuari: prova i la paraula de pas 123456)

Testing Controllers

What tot test?

Controller tests should verify responses, ensure that the correct database access methods are triggered, and assert that the appropriate instance variables are sent to the view.

The process of testing a controller can be divided into three pieces.

  • Isolate: Mock all dependencies (perhaps excluding the View).
  • Call: Trigger the desired controller method.
  • Ensure: Perform assertions, verifying that the stage has been set properly.

Resources: