-
Notifications
You must be signed in to change notification settings - Fork 14
How to generate tests and testing files
Added for version: 0.4
Updated for version: 0.7
To generate a model test for message use:
lein conjure generate model-test message
Generate will create a model test in test/unit/model called message_model_test.clj. Generate will also create a fixture for message.
To generate just a fixture for message use:
lein conjure generate fixture message
Generate will create a fixture file called ‘message.clj’ and put it in the test/fixture directory.
To generate a test for a view called ‘show’ with controller ‘message’ use:
lein conjure generate view-test message show
Generate will create a file called ‘show_view_test.clj’ in the directory test/unit/view/message directory.
To generate a test for a binding called ‘show’ with controller ‘message’ use:
lein conjure generate binding-test message show
Generate will create a file called ‘show_binding_test.clj’ in the directory test/unit/binding/message directory.
To generate a functional test for a controller named ‘message’ use:
lein conjure generate controller-test message
Generate will create a file called ‘message_controller_test.clj’ in the app/test/functional directory.
To generate a functional test for a controller named ‘message’ with actions ‘show’, ‘create’, and ‘edit’ use:
lein conjure generate controller-test message show create edit
Generate will create the test file as above, but also define tests for show create and edit in the test file.