Unit tests for defineModel