Add tests for quality and has_quality