diff options
author | Gabriel Silva Simões <simoes.sgabriel@gmail.com> | 2019-01-27 16:13:15 -0500 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-01-27 21:13:15 +0000 |
commit | 5f4a40c4a3d8afaaf9f3b43ded441a26c22c7f3b (patch) | |
tree | bd4617d29fc80b0ed797f62063349c83d9bc842a /integrations/repo_test.go | |
parent | 182a6d6885539a69fab9db89b9253d7ffb2cc4e2 (diff) | |
download | gitea-5f4a40c4a3d8afaaf9f3b43ded441a26c22c7f3b.tar.gz gitea-5f4a40c4a3d8afaaf9f3b43ded441a26c22c7f3b.zip |
Revert #3711 overwrite of only show "No Description" to repo admins #2167 (#5836)
Revert #3711 overwrite of only show "No Description" to repo admins #2167 and add tests to prevent accidental overwrite again.
Diffstat (limited to 'integrations/repo_test.go')
-rw-r--r-- | integrations/repo_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/integrations/repo_test.go b/integrations/repo_test.go index 165009faa2..36672ff62a 100644 --- a/integrations/repo_test.go +++ b/integrations/repo_test.go @@ -99,3 +99,23 @@ func TestViewRepoWithSymlinks(t *testing.T) { assert.Equal(t, items[3], "link_hi: octicon octicon-file-symlink-file") assert.Equal(t, items[4], "link_link: octicon octicon-file-symlink-file") } + +// TestViewAsRepoAdmin tests PR #2167 +func TestViewAsRepoAdmin(t *testing.T) { + for user, expectedNoDescription := range map[string]bool{ + "user2": true, + "user3": false, + } { + prepareTestEnv(t) + + session := loginUser(t, user) + + req := NewRequest(t, "GET", "/user2/repo1.git") + resp := session.MakeRequest(t, req, http.StatusOK) + + htmlDoc := NewHTMLParser(t, resp.Body) + noDescription := htmlDoc.doc.Find("#repo-desc").Children() + + assert.Equal(t, expectedNoDescription, noDescription.HasClass("no-description")) + } +} |