mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-19 15:40:50 +00:00
fix(web): forbid blocked users from reopening issues (#7010)
Closes https://codeberg.org/forgejo/forgejo/issues/6841. Signed-off-by: Litchi Pi <litchi.pi@proton.me> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7010 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Litchi Pi <litchi.pi@proton.me> Co-committed-by: Litchi Pi <litchi.pi@proton.me>
This commit is contained in:
parent
ac08fc5b40
commit
9dd47d932f
6 changed files with 69 additions and 4 deletions
|
@ -253,6 +253,12 @@ func TestBlockActions(t *testing.T) {
|
|||
DecodeJSON(t, resp, &errorResp)
|
||||
|
||||
assert.EqualValues(t, expectedMessage, errorResp.Error)
|
||||
|
||||
req = NewRequest(t, "GET", issue10URL)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
msg := htmlDoc.doc.Find("div .warning").Text()
|
||||
assert.Contains(t, msg, "You cannot comment on this issue because you are blocked")
|
||||
})
|
||||
|
||||
t.Run("Blocked by issue poster", func(t *testing.T) {
|
||||
|
@ -274,6 +280,12 @@ func TestBlockActions(t *testing.T) {
|
|||
DecodeJSON(t, resp, &errorResp)
|
||||
|
||||
assert.EqualValues(t, expectedMessage, errorResp.Error)
|
||||
|
||||
req = NewRequest(t, "GET", issue10URL)
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||
msg := htmlDoc.doc.Find("div .warning").Text()
|
||||
assert.Contains(t, msg, "You cannot comment on this issue because you are blocked")
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue