Skills Test S4 Model Validations and Tests
Learning Goals
Main Goals
- Use a web development platform (Rails) to create model validations to prevent bad data from being stored in the database.
- Use a web development platform (Rails) to create automated tests of the model.
Ancillary Goals
- Setup and maintain a functioning platform-based (Rails web) development environment.
- Use a web development platform (Rails) to create and use a back-end model class for storing data in a database.
Preparing for the Test
As always, make sure that you have gone through the General Skills Test Instructions.
This test emphasizes the material covered in the following demos, so you should go through them in detail, practicing the steps for creating model fixtures, model tests, and model validations.
- Creating and Testing Valid Fixtures
- Creating and Testing Presence Validations
- Creating and Testing Uniqueness Validations
- Creating and Testing Custom Validations
Practice Problems
Practice solving these old skills tests. To make the test apps run in these, you must edit config/database.yml
and comment out the username
and password
lines. You must also make sure that Ruby version 2.6.3 is installed by running the command rvm install 2.6.3
.
- https://github.com/memphis-cs/skills-test-2019-fall/tree/s06a
- https://github.com/memphis-cs/skills-test-2019-fall/tree/s06b
Additionally(!), practice making and testing custom validations as well.