anchor.diff:      ParamsWithOtherAddress = update_req_params(UserReqParams, OtherRestAddress, address),
   
       % Every user automatically gets his first space
  -    [[FirstUserSpace], DefaultUserSpace] = get_user_spaces(UserReqParams),
  -    ?assertMatch(DefaultUserSpace, FirstUserSpace),
  +    [[FirstSpace], DefaultSpace] = get_user_spaces(UserReqParams),
  +    ?assertMatch(DefaultSpace, FirstSpace),
   
       SID1 = create_space_for_user(?SPACE_NAME1, UserReqParams),
       SID2 = create_space_for_user(?SPACE_NAME1, ParamsWithOtherAddress),
       [SpaceIds, NewDefaultUserSpace] = get_user_spaces(UserReqParams),
       % Default space should not have changed
  -    ?assertMatch(NewDefaultUserSpace, DefaultUserSpace),
  -    ?assertMatch(lists:sort([SID1, SID2]), lists:sort(SpaceIds)).
  +    ?assertMatch(NewDefaultUserSpace, DefaultSpace),
  +    ExpectedSpaces = lists:sort([FirstSpace, SID1, SID2]),
  +    ?assertMatch(ExpectedSpaces, lists:sort(SpaceIds)).
   
   set_user_default_space_test(Config) ->
       UserReqParams = ?config(userReqParams, Config),
       OtherRestAddress = ?config(otherRestAddress, Config),
       ParamsWithOtherAddress = update_req_params(UserReqParams, OtherRestAddress, address),
   
  +
  +    % Every user automatically gets his first space
  +    [[FirstSpace], DefaultSpace] = get_user_spaces(UserReqParams),
  +    ?assertMatch(DefaultSpace, FirstSpace),
  +
       SID1 = create_space_for_user(?SPACE_NAME1, UserReqParams),
  -
  -    ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(UserReqParams)),
  -    ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(ParamsWithOtherAddress)),
  +    ExpectedSpaces = lists:sort([SID1, FirstSpace]),
  +    [NewSpaces1, NewDefaultSpace1] = get_user_spaces(UserReqParams),
  +    ?assertMatch(ExpectedSpaces, lists:sort(NewSpaces1)),
  +    ?assertMatch(NewDefaultSpace1, DefaultSpace),
  +    [NewSpaces2, NewDefaultSpace2] = get_user_spaces(ParamsWithOtherAddress),
  +    ?assertMatch(ExpectedSpaces, lists:sort(NewSpaces2)),
  +    ?assertMatch(NewDefaultSpace2, DefaultSpace),
  +
       ?assertMatch(ok, check_status(set_default_space_for_user(SID1, UserReqParams))),
  -    ?assertMatch([[SID1], SID1], get_user_spaces(UserReqParams)),
  -    ?assertMatch([[SID1], SID1], get_user_spaces(ParamsWithOtherAddress)),
  +    [NewSpaces3, NewDefaultSpace3] = get_user_spaces(UserReqParams),
  +    ?assertMatch(ExpectedSpaces, lists:sort(NewSpaces3)),
  +    ?assertMatch(NewDefaultSpace3, SID1),
  +    [NewSpaces4, NewDefaultSpace4] = get_user_spaces(ParamsWithOtherAddress),
  +    ?assertMatch(ExpectedSpaces, lists:sort(NewSpaces4)),
  +    ?assertMatch(NewDefaultSpace4, SID1),
       ?assertMatch(SID1, get_user_default_space(UserReqParams)),
       ?assertMatch(SID1, get_user_default_space(ParamsWithOtherAddress)).
   
  
positive.code:     SID1 = create_space_for_user(?SPACE_NAME1, UserReqParams),
      SID2 = <<"0">>,
  
      ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(UserReqParams)),
      ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(ParamsWithOtherAddress)),
      ?assertMatch({bad_response_code, _}, check_status(set_default_space_for_user(SID2, UserReqParams))),
      ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(UserReqParams)),
      ?assertMatch([[SID1], <<"undefined">>], get_user_spaces(ParamsWithOtherAddress)).
  
  user_gets_space_info_test(Config) ->
      UserReqParams = ?config(userReqParams, Config),
  
negative.code:     User2ParamsOtherAddress = update_req_params(User2ReqParams2, OtherRestAddress, address),
  
      %% check if space is in list of user2 space
      [User2Spaces, _] = get_user_spaces(User2ReqParams2),
      ?assert(lists:member(SID1, User2Spaces)),
      ?assertMatch([User2Spaces, _], get_user_spaces(User2ParamsOtherAddress)),
  
      %% check if user2 is in list of space's users
      ?assertMatch(true, is_included([UserId2], get_space_users(SID1, User2ReqParams2))),
  