 
     it 'should be to able login user when data is valid', (done) ->
 
+      # variables needed in the login method scope
       session                = null
       lastLoginDate          = null
       # generating user info with random username and password


        ->
          # setting a different email, username will be duplicate
          userInfo.email  = "kodingtestuser+#{TestHelper.getRandomString()}@gmail.com"
          expectedError   = "The slug #{userInfo.username} is not available."

          JUser.createUser userInfo, (err) ->


        ->
          # setting a different username, email will be duplicate
          userInfo.username = generateRandomString()
          expectedError     = "Sorry, \"#{userInfo.email}\" is already in use!"

          JUser.createUser userInfo, (err) ->
