Testing ActiveScaffold based Controllers

Published on Author Akhil Bansal2 Comments

If we are using ActiveScaffold in a controller, we might want to write test for that controller too. So we can write functional tests for all action that ActiveScaffold added to our controller like index, create, edit, update etc…

Since all these action are added by ActiveScaffold then these tests must go with ActiveScaffold plugin tests itself and I think they are at their place.

So we just need to test that ActiveScaffold is configured for that particular controller and uses the right model by:

assert_not_nil CampusController.active_scaffold_config 
assert CampusController.active_scaffold_config.model == Campus

Ofcourse, we also need to write tests for custom actions added by us.

2 Responses to Testing ActiveScaffold based Controllers

Leave a Reply

Your email address will not be published. Required fields are marked *