mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Disallow featuring hidden topics (#8814)
This commit is contained in:
committed by
GitHub
parent
dc34c24ffe
commit
089d38e9d3
@@ -3923,6 +3923,13 @@ describe UsersController do
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "returns an error if the topic is not visible" do
|
||||
sign_in(user)
|
||||
topic.update_status('visible', false, user)
|
||||
put "/u/#{user.username}/feature-topic.json", params: { topic_id: topic.id }
|
||||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
it "returns an error if the topic's category is read_restricted" do
|
||||
sign_in(user)
|
||||
category.set_permissions({})
|
||||
|
||||
Reference in New Issue
Block a user