testing factory($resource) angular with api rails