From 83d78aec8ff7def22690f9b61c5096c53bcc7a68 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Fri, 28 Feb 2020 17:31:42 +0100 Subject: [PATCH] Fix user tests --- tests/system/user_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/system/user_test.go b/tests/system/user_test.go index 0ff66410d..2f036ad0e 100644 --- a/tests/system/user_test.go +++ b/tests/system/user_test.go @@ -44,9 +44,20 @@ func TestUserRead(t *testing.T) { Expect(t). Status(http.StatusOK). Assert(helpers.AssertNoErrors). - Assert(jsonpath.Equal(`$.response.email`, u.Email)). + Assert(jsonpath.Contains(`$.response.email`, "####")). Assert(jsonpath.Equal(`$.response.userID`, fmt.Sprintf("%d", u.ID))). End() + + u = h.repoMakeUser(h.randEmail()) + h.allow(types.UserPermissionResource.AppendWildcard(), "unmask.email") + + h.apiInit(). + Get(fmt.Sprintf("/users/%d", u.ID)). + Expect(t). + Status(http.StatusOK). + Assert(helpers.AssertNoErrors). + Assert(jsonpath.Equal(`$.response.email`, u.Email)). + End() } func TestUserListAll(t *testing.T) { @@ -133,6 +144,7 @@ func TestUserListQueryEmail(t *testing.T) { h.secCtx() h.allow(types.UserPermissionResource.AppendWildcard(), "read") + h.allow(types.UserPermissionResource.AppendWildcard(), "unmask.email") ee := h.randEmail() h.repoMakeUser(ee)