summaryrefslogtreecommitdiffstats
path: root/integrations/setting_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/setting_test.go')
-rw-r--r--integrations/setting_test.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/integrations/setting_test.go b/integrations/setting_test.go
index 2aac8e90ed..54f4fded66 100644
--- a/integrations/setting_test.go
+++ b/integrations/setting_test.go
@@ -25,7 +25,7 @@ func TestSettingShowUserEmailExplore(t *testing.T) {
htmlDoc := NewHTMLParser(t, resp.Body)
assert.Contains(t,
htmlDoc.doc.Find(".ui.user.list").Text(),
- "user2@example.com",
+ "user4@example.com",
)
setting.UI.ShowUserEmail = false
@@ -35,7 +35,7 @@ func TestSettingShowUserEmailExplore(t *testing.T) {
htmlDoc = NewHTMLParser(t, resp.Body)
assert.NotContains(t,
htmlDoc.doc.Find(".ui.user.list").Text(),
- "user2@example.com",
+ "user4@example.com",
)
setting.UI.ShowUserEmail = showUserEmail
@@ -61,12 +61,23 @@ func TestSettingShowUserEmailProfile(t *testing.T) {
req = NewRequest(t, "GET", "/user2")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
- assert.NotContains(t,
+ // Should contain since this user owns the profile page
+ assert.Contains(t,
htmlDoc.doc.Find(".user.profile").Text(),
"user2@example.com",
)
setting.UI.ShowUserEmail = showUserEmail
+
+ session = loginUser(t, "user4")
+ 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",
+ )
+
}
func TestSettingLandingPage(t *testing.T) {