Added test for loginUser