unit tests for resource model