Closed JohnPostlethwait closed 10 years ago
There are unit tests that make sure you can create a valid model: https://github.com/geddy/model/blob/master/test/unit/create_user.js
The fixture for that one is here: https://github.com/geddy/model/blob/master/test/fixtures/user.js
You could add a separate test file that runs a test where you require the invalid model and ensure it throws.
run the tests by doing jake test
and run just the unit tests by doing jake test[unit]
.
Cool, I'll add tests, thanks for pointing me in the right direction!
Added tests!
Awesome, thanks!
When you tried to add a validator on a property that was non-existent, like this:
Gedddy Model would throw this error:
Which is not terribly helpful. When you add a validation for a non-existent property now, it will throw this error: