Testing Angular with REST API through $resource