summaryrefslogtreecommitdiffstats
path: root/tests/integration/setting_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/setting_test.go')
-rw-r--r--tests/integration/setting_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/integration/setting_test.go b/tests/integration/setting_test.go
index 777faf8cc0..cb8248e6e2 100644
--- a/tests/integration/setting_test.go
+++ b/tests/integration/setting_test.go
@@ -50,42 +50,42 @@ func TestSettingShowUserEmailProfile(t *testing.T) {
setting.UI.ShowUserEmail = true
- // user1 can see self
+ // user1 can see own visible email
session := loginUser(t, "user1")
req := NewRequest(t, "GET", "/user1")
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
- // user1 can not see user2
+ // user1 can not see user2's hidden email
req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
- // Should not contain even if the user visits their own profile page
+ // Should only contain if the user visits their own profile page
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com")
- // user2 can see user1
+ // user2 can see user1's visible email
session = loginUser(t, "user2")
req = NewRequest(t, "GET", "/user1")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
- // user2 can not see self
+ // user2 can see own hidden email
session = loginUser(t, "user2")
req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
- assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com")
+ assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user2@example.com")
setting.UI.ShowUserEmail = false
- // user1 can not see self
+ // user1 can see own (now hidden) email
session = loginUser(t, "user1")
req = NewRequest(t, "GET", "/user1")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
- assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
+ assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "user1@example.com")
setting.UI.ShowUserEmail = showUserEmail
}