Skip to content

Commit

Permalink
Fix permission tests (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev authored Oct 10, 2017
1 parent d31db5a commit f257663
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ X.Y.Z (TBD)
### Bug fixes

### Breaking Changes
- `AcceptPermissionOfferAsync` now returns the relative rather than the absolute url of the Realm the user has been granted permissions to. ([#1595](https://github.com/realm/realm-dotnet/pull/1595))

2.0.0-rc1 (2017-10-03)
------------------
Expand Down
2 changes: 1 addition & 1 deletion Platform.PCL/Realm.Sync.PCL/UserPCL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public Task<string> OfferPermissionsAsync(string realmUrl, AccessLevel accessLev
/// <summary>
/// Consumes a token generated by <see cref="OfferPermissionsAsync"/> to obtain permissions to a shared Realm.
/// </summary>
/// <returns>The url of the Realm that the token has granted permissions to.</returns>
/// <returns>The relative url of the Realm that the token has granted permissions to.</returns>
/// <param name="offerToken">The token, generated by <see cref="OfferPermissionsAsync"/>.</param>
public Task<string> AcceptPermissionOfferAsync(string offerToken)
{
Expand Down
2 changes: 1 addition & 1 deletion Realm/Realm.Sync/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public async Task<string> OfferPermissionsAsync(string realmUrl, AccessLevel acc
/// <summary>
/// Consumes a token generated by <see cref="OfferPermissionsAsync"/> to obtain permissions to a shared Realm.
/// </summary>
/// <returns>The url of the Realm that the token has granted permissions to.</returns>
/// <returns>The relative url of the Realm that the token has granted permissions to.</returns>
/// <param name="offerToken">The token, generated by <see cref="OfferPermissionsAsync"/>.</param>
public async Task<string> AcceptPermissionOfferAsync(string offerToken)
{
Expand Down
4 changes: 2 additions & 2 deletions Tests/Tests.Sync.Shared/PermissionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public void User_OfferPermissions_GrantsPermissions()
var token = await alice.OfferPermissionsAsync(realmUrl, AccessLevel.Write).Timeout(2000);
var alicesUrl = await bob.AcceptPermissionOfferAsync(token).Timeout(2000);

Assert.That(alicesUrl, Is.EqualTo(realmUrl));
Assert.That($"realm://{Constants.ServerUrl}:9080/{alicesUrl}", Is.EqualTo(realmUrl));

await AssertPermissions(alice, bob, realmPath, AccessLevel.Write).Timeout(10000);
});
Expand Down Expand Up @@ -515,7 +515,7 @@ private async Task<string> GrantPermissions(User granter, User receiver, bool ma
Assert.That(permissionResponse.Status, Is.EqualTo(ManagementObjectStatus.Success));
Assert.That(permissionResponse.RealmUrl, Is.Not.Null);

return permissionResponse.RealmUrl;
return $"realm://{Constants.ServerUrl}:9080/{permissionResponse.RealmUrl}";
}

private async Task ValidateWriteAndSync(string realmUrl, User first, User second, long firstObjectId, long secondObjectId)
Expand Down
1 change: 1 addition & 0 deletions Tests/Tests.Sync.Shared/SSLConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace Tests.Sync
#if !ROS_SETUP
[NUnit.Framework.Explicit]
#endif
[Ignore("Reenable when ROS fixes SSL support.")]
[TestFixture, Preserve(AllMembers = true)]
public class SSLConfigurationTests : SyncTestBase
{
Expand Down

0 comments on commit f257663

Please sign in to comment.