Rewrite Jasmine tests using $.each() method.