anchor.diff:      SID = create_space_for_user(?SPACE_NAME1, UserReqParams),
       ?assertMatch([SID, ?SPACE_NAME1], get_space_info_by_user(SID, UserReqParams)).
   
  -user_delete_space_test(Config) ->
  +last_user_leaves_space_test(Config) ->
       UserReqParams = ?config(userReqParams, Config),
   
       SID1 = create_space_for_user(?SPACE_NAME1, UserReqParams),
  -    ?assertMatch(ok, check_status(delete_space_by_user(SID1, UserReqParams))),
  +    ?assertMatch(ok, check_status(user_leaves_space(SID1, UserReqParams))),
       ?assertMatch([[],<<"undefined">>], get_user_spaces(UserReqParams)).
   
  -user_space_invitation_test(Config) ->
  +not_last_user_leaves_space_test(Config) ->
  +    ProviderId = ?config(providerId, Config),
  +    ProviderReqParams = ?config(providerReqParams, Config),
  +    UserReqParams1 = ?config(userReqParams, Config),
  +
  +    {_UserId2, UserReqParams2} =
  +        register_user(?USER_NAME2, ProviderId, Config, ProviderReqParams),
  +    SID1 = create_space_for_user(?SPACE_NAME1, UserReqParams1),
  +    InvitationToken = get_space_invitation_token(users, SID1, UserReqParams1),
  +    
  +    join_user_to_space(InvitationToken, UserReqParams2),
  +    
  +    ?assertMatch(ok, check_status(user_leaves_space(SID1, UserReqParams2))),
  +    ?assertMatch([[SID1],<<"undefined">>], get_user_spaces(UserReqParams1)),
  +    ?assertMatch([[],<<"undefined">>], get_user_spaces(UserReqParams2)).
  +
  +invite_user_to_space_test(Config) ->
       ProviderId = ?config(providerId, Config),
       ProviderReqParams = ?config(providerReqParams, Config),
       UserReqParams1 = ?config(userReqParams, Config),
  
positive.code:     SCRToken1 = get_space_creation_token_for_user(UserReqParams),
      SID = create_and_support_space(SCRToken1, ?SPACE_NAME1, ?SPACE_SIZE1, ProviderReqParams),
  
      ?assertMatch(ok, check_status(delete_space(SID, ProviderReqParams))).
  
  support_space_test(Config) ->
      ProviderReqParams = ?config(providerReqParams, Config),
  
negative.code:         do_request(
              RestAddress ++ "/groups/" ++ binary_to_list(GID)++ "/spaces", Headers, get, [], Options
          ),
  %%     TODO usunac printa
      ct:pal("DEBUG: ~p~n", [Response]),
      [Spaces] = get_body_val([spaces], Response),
      Spaces.
  
  